adding text gen pipeline
Browse files
app.py
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
|
|
3 |
#generates an AI description of your character
|
4 |
def describe(names):
|
5 |
-
return "Hello " +
|
6 |
|
7 |
-
iface = gr.Interface(fn=describe, inputs=gr.Textbox(label="
|
|
|
8 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
pipe = pipeline("text-generation", model="mistralai/Mistral-7B-v0.1")
|
6 |
+
|
7 |
#generates an AI description of your character
|
8 |
def describe(names):
|
9 |
+
return "Hello " + pipe(names) + "!!"
|
10 |
|
11 |
+
iface = gr.Interface(fn=describe, inputs=gr.Textbox(label="Your DND character",show_label=True),
|
12 |
+
outputs=gr.Textbox(label="The character",show_label=True))
|
13 |
iface.launch()
|