Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,16 +36,12 @@ The following SQL query best answers the question `{user_question}`:
|
|
| 36 |
eos_token_id=tokenizer.eos_token_id,
|
| 37 |
pad_token_id=tokenizer.eos_token_id,
|
| 38 |
max_new_tokens=400,
|
| 39 |
-
do_sample=False,
|
| 40 |
num_beams=1,
|
| 41 |
)
|
| 42 |
outputs = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
| 43 |
|
| 44 |
torch.cuda.empty_cache()
|
| 45 |
torch.cuda.synchronize()
|
| 46 |
-
# empty cache so that you do generate more results w/o memory crashing
|
| 47 |
-
# particularly important on Colab – memory management is much more straightforward
|
| 48 |
-
# when running on an inference service
|
| 49 |
return sqlparse.format(outputs[0].split("[SQL]")[-1], reindent=True)
|
| 50 |
|
| 51 |
|
|
|
|
| 36 |
eos_token_id=tokenizer.eos_token_id,
|
| 37 |
pad_token_id=tokenizer.eos_token_id,
|
| 38 |
max_new_tokens=400,
|
|
|
|
| 39 |
num_beams=1,
|
| 40 |
)
|
| 41 |
outputs = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
| 42 |
|
| 43 |
torch.cuda.empty_cache()
|
| 44 |
torch.cuda.synchronize()
|
|
|
|
|
|
|
|
|
|
| 45 |
return sqlparse.format(outputs[0].split("[SQL]")[-1], reindent=True)
|
| 46 |
|
| 47 |
|