Spaces:
Sleeping
Sleeping
BMike10
commited on
Commit
•
54dfe3d
1
Parent(s):
84bb75b
Doc: Changes
Browse files
app.py
CHANGED
@@ -1,13 +1,21 @@
|
|
1 |
import random
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
|
5 |
def random_response(message, history):
|
6 |
return random.choice(["Yes", "No"])
|
7 |
|
8 |
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import random
|
2 |
import gradio as gr
|
3 |
+
from transformers import pipeline
|
4 |
|
5 |
|
6 |
def random_response(message, history):
|
7 |
return random.choice(["Yes", "No"])
|
8 |
|
9 |
|
10 |
+
generator = pipeline(model="michelebasilico/itaca-mistral-7b-v2-4bit")
|
11 |
|
12 |
+
|
13 |
+
def predict(message, history):
|
14 |
+
outputs = generator(message, num_return_sequences=4,
|
15 |
+
return_full_text=False)
|
16 |
+
|
17 |
+
return outputs
|
18 |
+
|
19 |
+
|
20 |
+
iface = gr.ChatInterface(predict)
|
21 |
+
iface.launch()
|