grpathak22 commited on
Commit
eaca639
·
verified ·
1 Parent(s): 1c50f5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -62,16 +62,17 @@ trainer = Trainer(
62
  # Fine-tune the model
63
  trainer.train()
64
 
65
- prompt = "मस्तवाल हत्ती चाळवणं"
 
 
 
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=512)
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)