Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
-
from
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
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)
|