Spaces:
Sleeping
Sleeping
Update helper.py
Browse files
helper.py
CHANGED
@@ -114,7 +114,7 @@ def registry(name: str = None, **kwargs) -> gr.ChatInterface:
|
|
114 |
predict_fn = get_fn(model_name=name, **kwargs)
|
115 |
|
116 |
# Define a wrapper function that integrates preprocessing and postprocessing
|
117 |
-
def wrapper(message, history, system_prompt, temperature, max_tokens,
|
118 |
# Preprocess the inputs
|
119 |
preprocessed = preprocess(message, history)
|
120 |
|
@@ -132,7 +132,7 @@ def registry(name: str = None, **kwargs) -> gr.ChatInterface:
|
|
132 |
# Collect the generated response
|
133 |
response = ""
|
134 |
for partial_response in response_generator:
|
135 |
-
response
|
136 |
yield response
|
137 |
|
138 |
# Create the Gradio ChatInterface with the wrapper function
|
|
|
114 |
predict_fn = get_fn(model_name=name, **kwargs)
|
115 |
|
116 |
# Define a wrapper function that integrates preprocessing and postprocessing
|
117 |
+
def wrapper(message, history, system_prompt, temperature, max_tokens, top_p):
|
118 |
# Preprocess the inputs
|
119 |
preprocessed = preprocess(message, history)
|
120 |
|
|
|
132 |
# Collect the generated response
|
133 |
response = ""
|
134 |
for partial_response in response_generator:
|
135 |
+
response += partial_response # Gradio will handle streaming
|
136 |
yield response
|
137 |
|
138 |
# Create the Gradio ChatInterface with the wrapper function
|