Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,4 @@
|
|
| 1 |
-
import torch
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
"text-generation",
|
| 7 |
-
model=model_id,
|
| 8 |
-
torch_dtype=torch.bfloat16,
|
| 9 |
-
device_map="auto",
|
| 10 |
-
)
|
| 11 |
-
messages = [
|
| 12 |
-
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
| 13 |
-
{"role": "user", "content": "Who are you?"},
|
| 14 |
-
]
|
| 15 |
-
outputs = pipe(
|
| 16 |
-
messages,
|
| 17 |
-
max_new_tokens=256,
|
| 18 |
-
)
|
| 19 |
-
print(outputs[0]["generated_text"][-1])
|
|
|
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
+
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')
|
| 4 |
+
generator("EleutherAI has", do_sample=True, min_length=50)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|