Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,16 +62,17 @@ trainer = Trainer(
|
|
62 |
# Fine-tune the model
|
63 |
trainer.train()
|
64 |
|
65 |
-
|
|
|
|
|
|
|
66 |
|
67 |
# Tokenize the input prompt
|
68 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
69 |
|
70 |
# Generate the output
|
71 |
-
output_ids = model.generate(input_ids, max_length=
|
72 |
|
73 |
# Decode the output to text
|
74 |
-
topic = st.text_input("Enter your proverb: ")
|
75 |
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
76 |
st.write(output_text)
|
77 |
-
|
|
|
62 |
# Fine-tune the model
|
63 |
trainer.train()
|
64 |
|
65 |
+
model.save_pretrained("./fine-tuned-mt5-marathi-proverbs")
|
66 |
+
tokenizer.save_pretrained("./fine-tuned-mt5-marathi-proverbs")
|
67 |
+
|
68 |
+
prompt = st.text_input("Enter your proverb: ")
|
69 |
|
70 |
# Tokenize the input prompt
|
71 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
72 |
|
73 |
# Generate the output
|
74 |
+
output_ids = model.generate(input_ids, max_length=256)
|
75 |
|
76 |
# Decode the output to text
|
|
|
77 |
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
78 |
st.write(output_text)
|
|