Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ class FalconChatBot:
|
|
59 |
# Encode the conversation using the tokenizer
|
60 |
input_ids = tokenizer.encode(conversation, return_tensors="pt", add_special_tokens=False)
|
61 |
# Generate a response using the Falcon model
|
62 |
-
response =
|
63 |
# Decode the generated response to text
|
64 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
65 |
# Append the Falcon-like conversation to the history
|
|
|
59 |
# Encode the conversation using the tokenizer
|
60 |
input_ids = tokenizer.encode(conversation, return_tensors="pt", add_special_tokens=False)
|
61 |
# Generate a response using the Falcon model
|
62 |
+
response = model.generate(input_ids=input_ids, max_length=max_length, use_cache=False, early_stopping=False, bos_token_id=model.config.bos_token_id, eos_token_id=model.config.eos_token_id, pad_token_id=peft_model.config.eos_token_id, temperature=0.4, do_sample=True)
|
63 |
# Decode the generated response to text
|
64 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
65 |
# Append the Falcon-like conversation to the history
|