Spaces:
Runtime error
Runtime error
AlexWortega
commited on
Commit
·
a9d7e51
1
Parent(s):
6626628
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def ans(question, description='', category=''):
|
|
9 |
print(f'Seed: {seed}')
|
10 |
torch.manual_seed(seed)
|
11 |
|
12 |
-
inp = tokenizer.encode(f'{"Категория: " + category + "
|
13 |
print('question',question)
|
14 |
gen = model.generate(inp, do_sample=True, top_p=0.9, temperature=0.86, max_new_tokens=100, repetition_penalty=1.2) #, stop_token="<eos>")
|
15 |
|
|
|
9 |
print(f'Seed: {seed}')
|
10 |
torch.manual_seed(seed)
|
11 |
|
12 |
+
inp = tokenizer.encode(f'{"Категория: " + category + "" if category else ""}Вопрос: {question}Описание: {description}Ответ:',return_tensors="pt").to(device)
|
13 |
print('question',question)
|
14 |
gen = model.generate(inp, do_sample=True, top_p=0.9, temperature=0.86, max_new_tokens=100, repetition_penalty=1.2) #, stop_token="<eos>")
|
15 |
|