Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
|
6 |
-
def
|
7 |
-
|
8 |
-
return
|
|
|
|
|
9 |
|
10 |
-
iface = gr.Interface(fn=generate, inputs="text", outputs="text", title="FlareNew Text Generation")
|
11 |
-
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
pipe = pipeline("text-generation","TheBloke/Mistral-7B-Instruct-v0.1-GGUF")
|
5 |
|
6 |
+
def chat_fn(message, history):
|
7 |
+
response = pipe(message, max_new_tokens=200)[0]["generated_text"]
|
8 |
+
return response
|
9 |
+
|
10 |
+
gr.ChatInterface(fn=chat_fn).launch()
|
11 |
|
|
|
|