Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,17 +3,19 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
pipe = pipeline(
|
| 5 |
"text-generation",
|
| 6 |
-
model="EleutherAI/
|
| 7 |
)
|
| 8 |
|
| 9 |
def chat(user_input):
|
| 10 |
output = pipe(
|
| 11 |
user_input,
|
| 12 |
-
max_length=
|
| 13 |
do_sample=True,
|
| 14 |
top_k=50,
|
| 15 |
-
top_p=0.
|
| 16 |
-
temperature=0.
|
| 17 |
)[0]['generated_text']
|
| 18 |
return output
|
| 19 |
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
pipe = pipeline(
|
| 5 |
"text-generation",
|
| 6 |
+
model="EleutherAI/MPT-7B-Instruct" # or MPT-7B-Instruct for better results
|
| 7 |
)
|
| 8 |
|
| 9 |
def chat(user_input):
|
| 10 |
output = pipe(
|
| 11 |
user_input,
|
| 12 |
+
max_length=100,
|
| 13 |
do_sample=True,
|
| 14 |
top_k=50,
|
| 15 |
+
top_p=0.9,
|
| 16 |
+
temperature=0.6
|
| 17 |
)[0]['generated_text']
|
| 18 |
return output
|
| 19 |
|
| 20 |
+
demo = gr.Interface(fn=chat, inputs="text", outputs="text")
|
| 21 |
+
demo.launch()
|