Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,10 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
# Load the model
|
| 5 |
-
pipe = pipeline("text2text-generation", model="
|
| 6 |
|
| 7 |
def convert_to_json(text):
|
| 8 |
-
prompt = f"Convert the following sentence into a JSON object with keys: userId, type, category, amount, date, note
|
| 9 |
output = pipe(prompt, max_new_tokens=200)[0]["generated_text"]
|
| 10 |
return output
|
| 11 |
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
# Load the model
|
| 5 |
+
pipe = pipeline("text2text-generation", model="declare-lab/flan-alpaca-base")
|
| 6 |
|
| 7 |
def convert_to_json(text):
|
| 8 |
+
prompt = f"Convert the following sentence into a JSON object with keys: userId, type, category, amount, date, note: {text}"
|
| 9 |
output = pipe(prompt, max_new_tokens=200)[0]["generated_text"]
|
| 10 |
return output
|
| 11 |
|