Erfan11 commited on
Commit
5574831
1 Parent(s): cc090e8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -3
main.py CHANGED
@@ -1,4 +1,8 @@
1
- from app import app
2
 
3
- if __name__ == '__main__':
4
- app.run(debug=True)
 
 
 
 
 
1
+ from load_model import load_model
2
 
3
+ model, tokenizer = load_model()
4
+
5
+ def generate_response(prompt):
6
+ inputs = tokenizer(prompt, return_tensors="pt")
7
+ outputs = model.generate(inputs['input_ids'])
8
+ return tokenizer.decode(outputs[0], skip_special_tokens=True)