Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
pipe = pipeline("translation", model="emya/vicuna-7b-v1.5-steve-jobs-v1")
|
| 6 |
+
|
| 7 |
+
def predict(text):
|
| 8 |
+
prompt = f"{text} (Answer in a few sentences)"
|
| 9 |
+
return pipe(prompt)[0]["translation_text"]
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=predict,
|
| 13 |
+
inputs='text',
|
| 14 |
+
outputs='text',
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
demo.launch()
|