Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
inputs = tokenizer(message, return_tensors="pt")
|
| 11 |
-
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 12 |
-
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 13 |
-
return response
|
| 14 |
-
|
| 15 |
-
gr.ChatInterface(chat, title="MiniCrit Demo").launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
def chat(input_text):
|
| 4 |
+
return f"MiniCrit Demo Received: {input_text}"
|
| 5 |
|
| 6 |
+
iface = gr.Interface(
|
| 7 |
+
fn=chat,
|
| 8 |
+
inputs="text",
|
| 9 |
+
outputs="text",
|
| 10 |
+
title="MiniCrit Demo",
|
| 11 |
+
description="Demo interface placeholder."
|
| 12 |
+
)
|
| 13 |
|
| 14 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|