Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,9 +34,9 @@ def multimodal_prompt(user_input, system_prompt="You are an expert medical analy
|
|
34 |
max_length=500,
|
35 |
use_cache=True,
|
36 |
early_stopping=False,
|
37 |
-
bos_token_id=
|
38 |
-
eos_token_id=
|
39 |
-
pad_token_id=
|
40 |
temperature=0.4,
|
41 |
do_sample=True
|
42 |
)
|
@@ -91,7 +91,7 @@ class ChatBot:
|
|
91 |
input_ids = tokenizer.encode(formatted_input, return_tensors="pt", add_special_tokens=False)
|
92 |
|
93 |
# Generate a response using the model
|
94 |
-
response = peft_model.generate(input_ids, max_length=900, use_cache=False, early_stopping=False, bos_token_id=
|
95 |
|
96 |
# Decode the generated response to text
|
97 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
|
|
34 |
max_length=500,
|
35 |
use_cache=True,
|
36 |
early_stopping=False,
|
37 |
+
bos_token_id=peft_model.config.bos_token_id,
|
38 |
+
eos_token_id=peft_model.config.eos_token_id,
|
39 |
+
pad_token_id=peft_model.config.eos_token_id,
|
40 |
temperature=0.4,
|
41 |
do_sample=True
|
42 |
)
|
|
|
91 |
input_ids = tokenizer.encode(formatted_input, return_tensors="pt", add_special_tokens=False)
|
92 |
|
93 |
# Generate a response using the model
|
94 |
+
response = peft_model.generate(input_ids, max_length=900, use_cache=False, early_stopping=False, bos_token_id=peft_model.config.bos_token_id, eos_token_id=peft_model.config.eos_token_id, pad_token_id=peft_model.config.eos_token_id, temperature=0.4, do_sample=True)
|
95 |
|
96 |
# Decode the generated response to text
|
97 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|