Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,12 +63,14 @@ pipe = pipeline(
|
|
| 63 |
model=model,
|
| 64 |
tokenizer=tokenizer,
|
| 65 |
max_length=1024,
|
| 66 |
-
temperature=0.
|
| 67 |
-
top_p=0.9,
|
| 68 |
-
repetition_penalty=1.
|
| 69 |
-
|
|
|
|
| 70 |
)
|
| 71 |
|
|
|
|
| 72 |
# Function to generate a response from the Llama model
|
| 73 |
@spaces.GPU()
|
| 74 |
def get_llama_response(message: str, history: list) -> str:
|
|
|
|
| 63 |
model=model,
|
| 64 |
tokenizer=tokenizer,
|
| 65 |
max_length=1024,
|
| 66 |
+
temperature=0.1, # Adjust temperature
|
| 67 |
+
top_p=0.9,# Adjust top_p
|
| 68 |
+
repetition_penalty=1.1, # Increase repetition penalty
|
| 69 |
+
no_repeat_ngram_size=3, # Prevent repeating n-grams of size 3
|
| 70 |
+
do_sample=True, # Set to False for deterministic output
|
| 71 |
)
|
| 72 |
|
| 73 |
+
|
| 74 |
# Function to generate a response from the Llama model
|
| 75 |
@spaces.GPU()
|
| 76 |
def get_llama_response(message: str, history: list) -> str:
|