Spaces:
Runtime error
Runtime error
update 4 app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,8 @@
|
|
| 1 |
-
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
response = model(history)
|
| 10 |
-
history[-1] = (message, response[0]['generated_text'])
|
| 11 |
-
return history, ""
|
| 12 |
-
|
| 13 |
-
# Создание интерфейса
|
| 14 |
-
iface = gr.ChatInterface(chat)
|
| 15 |
-
|
| 16 |
-
# Запуск интерфейса
|
| 17 |
-
iface.launch()
|
|
|
|
| 1 |
+
# Use a pipeline as a high-level helper
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
messages = [
|
| 5 |
+
{"role": "user", "content": "Who are you?"},
|
| 6 |
+
]
|
| 7 |
+
pipe = pipeline("text-generation", model="LLM360/K2-Chat")
|
| 8 |
+
pipe(messages)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|