Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,7 +60,7 @@ def generate_sql(query,context):
|
|
| 60 |
prompt = query
|
| 61 |
context=context
|
| 62 |
text=f"<s>##Question: {prompt} \n ##Context: {context} \n ##Answer:"
|
| 63 |
-
inputs=tokenizer(text,return_tensors='pt').to('
|
| 64 |
with torch.no_grad():
|
| 65 |
outputs=model.generate(**inputs,max_new_tokens=100,do_sample=True,top_p=0.99,top_k=10,temperature=0.5)
|
| 66 |
output_text=outputs[:, inputs.input_ids.shape[1]:]
|
|
|
|
| 60 |
prompt = query
|
| 61 |
context=context
|
| 62 |
text=f"<s>##Question: {prompt} \n ##Context: {context} \n ##Answer:"
|
| 63 |
+
inputs=tokenizer(text,return_tensors='pt').to('cpu')
|
| 64 |
with torch.no_grad():
|
| 65 |
outputs=model.generate(**inputs,max_new_tokens=100,do_sample=True,top_p=0.99,top_k=10,temperature=0.5)
|
| 66 |
output_text=outputs[:, inputs.input_ids.shape[1]:]
|