Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,16 +134,14 @@ def respond(
|
|
| 134 |
|
| 135 |
# Generate response
|
| 136 |
try:
|
| 137 |
-
|
| 138 |
-
|
| 139 |
full_prompt,
|
| 140 |
-
|
| 141 |
stop=["User:", "\n"], # Stop on new user input
|
| 142 |
temperature=temperature,
|
| 143 |
-
top_p=top_p
|
| 144 |
-
|
| 145 |
-
):
|
| 146 |
-
response += chunk
|
| 147 |
|
| 148 |
return response
|
| 149 |
except Exception as e:
|
|
|
|
| 134 |
|
| 135 |
# Generate response
|
| 136 |
try:
|
| 137 |
+
# Use the correct method signature for llama-cpp-python
|
| 138 |
+
response = llm_model(
|
| 139 |
full_prompt,
|
| 140 |
+
max_new_tokens=max_tokens, # Changed from max_tokens to max_new_tokens
|
| 141 |
stop=["User:", "\n"], # Stop on new user input
|
| 142 |
temperature=temperature,
|
| 143 |
+
top_p=top_p
|
| 144 |
+
)['choices'][0]['text']
|
|
|
|
|
|
|
| 145 |
|
| 146 |
return response
|
| 147 |
except Exception as e:
|