Spaces:
Running
on
Zero
Running
on
Zero
Update README.md
Browse files
README.md
CHANGED
@@ -31,7 +31,27 @@ Storyteller is an AI-powered creative writing assistant that generates stories i
|
|
31 |
|
32 |
### Implementation
|
33 |
- **Framework**: Built with Gradio 5.18.0
|
34 |
-
- **Pipeline Architecture**: Uses Hugging Face Transformers Pipeline as the core component
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
- **GPU Handling**: Uses Hugging Face Spaces GPU support with ZeroGPU for efficient resource allocation
|
36 |
- **Prompt Engineering**: Enhanced prompting technique for better story structure and coherence
|
37 |
|
|
|
31 |
|
32 |
### Implementation
|
33 |
- **Framework**: Built with Gradio 5.18.0
|
34 |
+
- **Pipeline Architecture**: Uses Hugging Face Transformers Pipeline as the core component:
|
35 |
+
```python
|
36 |
+
from transformers import pipeline
|
37 |
+
|
38 |
+
# Create the text generation pipeline
|
39 |
+
generator = pipeline(
|
40 |
+
"text-generation",
|
41 |
+
model=model,
|
42 |
+
tokenizer=tokenizer,
|
43 |
+
device=0 # Use GPU
|
44 |
+
)
|
45 |
+
|
46 |
+
# Generate text with the pipeline
|
47 |
+
response = generator(
|
48 |
+
prompt,
|
49 |
+
max_length=max_length,
|
50 |
+
temperature=temperature,
|
51 |
+
top_p=top_p,
|
52 |
+
do_sample=True
|
53 |
+
)
|
54 |
+
```
|
55 |
- **GPU Handling**: Uses Hugging Face Spaces GPU support with ZeroGPU for efficient resource allocation
|
56 |
- **Prompt Engineering**: Enhanced prompting technique for better story structure and coherence
|
57 |
|