Update app.py
Browse files
app.py
CHANGED
@@ -34,16 +34,6 @@ def load_model(model_name):
|
|
34 |
model_cache[model_name] = model
|
35 |
return model_cache[model_name]
|
36 |
|
37 |
-
|
38 |
-
def generate_text(input_text, selected_model):
|
39 |
-
"""
|
40 |
-
Generate text using the selected model.
|
41 |
-
This function now uses the caching mechanism to load models.
|
42 |
-
"""
|
43 |
-
model = load_model_with_cache(selected_model)
|
44 |
-
output = model.generate(input_text, max_tokens=100)
|
45 |
-
return output
|
46 |
-
|
47 |
# clear = gr.ClearButton([input_text, chatbot])
|
48 |
|
49 |
# Define the chatbot function
|
|
|
34 |
model_cache[model_name] = model
|
35 |
return model_cache[model_name]
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
# clear = gr.ClearButton([input_text, chatbot])
|
38 |
|
39 |
# Define the chatbot function
|