Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -25,7 +25,9 @@ device = ("cuda"
|
|
| 25 |
logging.info(C("[INFO] "f"device = {device}"))
|
| 26 |
|
| 27 |
# ------------------ INITITALIZE ------------------- #
|
| 28 |
-
@st.cache
|
|
|
|
|
|
|
| 29 |
def model_init():
|
| 30 |
|
| 31 |
|
|
@@ -68,8 +70,10 @@ try:
|
|
| 68 |
[texts_out] = model.generate(
|
| 69 |
**tokenizer(
|
| 70 |
prompt, return_tensors="pt",
|
| 71 |
-
|
| 72 |
-
).to(device)
|
|
|
|
|
|
|
| 73 |
output_text = tokenizer.decode(texts_out)
|
| 74 |
st.balloons()
|
| 75 |
st.markdown(output_text)
|
|
|
|
| 25 |
logging.info(C("[INFO] "f"device = {device}"))
|
| 26 |
|
| 27 |
# ------------------ INITITALIZE ------------------- #
|
| 28 |
+
@st.cache(
|
| 29 |
+
suppress_st_warning=True
|
| 30 |
+
)
|
| 31 |
def model_init():
|
| 32 |
|
| 33 |
|
|
|
|
| 70 |
[texts_out] = model.generate(
|
| 71 |
**tokenizer(
|
| 72 |
prompt, return_tensors="pt",
|
| 73 |
+
|
| 74 |
+
).to(device),
|
| 75 |
+
max_new_tokens=200,
|
| 76 |
+
)
|
| 77 |
output_text = tokenizer.decode(texts_out)
|
| 78 |
st.balloons()
|
| 79 |
st.markdown(output_text)
|