rodrigomasini commited on
Commit
fdb64df
·
verified ·
1 Parent(s): 40abfbf

Update helper.py

Browse files
Files changed (1) hide show
  1. helper.py +2 -2
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, top_k, repetition_penalty, top_p):
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 = partial_response # Gradio will handle streaming
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