Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,11 +22,11 @@ tokenizer, model = load_model()
|
|
| 22 |
|
| 23 |
|
| 24 |
@spaces.GPU
|
| 25 |
-
def generate(
|
| 26 |
-
conversation =
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
print(conversation)
|
| 29 |
-
|
| 30 |
inputs = tokenizer.apply_chat_template(
|
| 31 |
conversation,
|
| 32 |
add_generation_prompt=True,
|
|
@@ -46,4 +46,4 @@ def generate(message, history):
|
|
| 46 |
|
| 47 |
|
| 48 |
demo = gr.ChatInterface(fn=generate, type="messages", examples=["hello", "hola", "merhaba"], title="NanoChat")
|
| 49 |
-
demo.launch()
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
@spaces.GPU
|
| 25 |
+
def generate(prompt, history):
|
| 26 |
+
conversation = [
|
| 27 |
+
{"role": "user", "content": prompt},
|
| 28 |
+
]
|
| 29 |
|
|
|
|
|
|
|
| 30 |
inputs = tokenizer.apply_chat_template(
|
| 31 |
conversation,
|
| 32 |
add_generation_prompt=True,
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
demo = gr.ChatInterface(fn=generate, type="messages", examples=["hello", "hola", "merhaba"], title="NanoChat")
|
| 49 |
+
demo.launch()
|