Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,17 +5,4 @@ p = subprocess.Popen(["pip", "freeze"], stdout=subprocess.PIPE)
|
|
5 |
output = p.communicate()[0]
|
6 |
st.code(output.decode("utf-8"))
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
from transformers import AutoTokenizer
|
11 |
-
from fastT5 import export_and_get_onnx_model, get_onnx_model # this line will throw an error
|
12 |
-
|
13 |
-
model = export_and_get_onnx_model(MODEL_NAME)
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
|
15 |
-
|
16 |
-
tokenized = tokenizer("Will this work?", return_tensors="pt")
|
17 |
-
tokens = model.generate(
|
18 |
-
input_ids=tokenized["input_ids"],
|
19 |
-
attention_mask=tokenized["attention_mask"],
|
20 |
-
)
|
21 |
-
st.write(tokenizer.decode(tokens.squeeze(), skip_special_tokens=True))
|
|
|
5 |
output = p.communicate()[0]
|
6 |
st.code(output.decode("utf-8"))
|
7 |
|
8 |
+
from transformers import AutoModelForSeq2SeqLM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|