Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ def interact(user_input, history, interaction_count):
|
|
105 |
formatted_history = [(entry["content"], None) if entry["role"] == "user" else (None, entry["content"]) for entry in history if entry["role"] in ["user", "assistant"]]
|
106 |
return "", formatted_history, history, interaction_count
|
107 |
except Exception as e:
|
108 |
-
if torch.cuda.
|
109 |
torch.cuda.empty_cache()
|
110 |
print(f"Error during interaction: {e}")
|
111 |
raise gr.Error(f"An error occurred during interaction: {str(e)}")
|
|
|
105 |
formatted_history = [(entry["content"], None) if entry["role"] == "user" else (None, entry["content"]) for entry in history if entry["role"] in ["user", "assistant"]]
|
106 |
return "", formatted_history, history, interaction_count
|
107 |
except Exception as e:
|
108 |
+
if torch.cuda.is_available():
|
109 |
torch.cuda.empty_cache()
|
110 |
print(f"Error during interaction: {e}")
|
111 |
raise gr.Error(f"An error occurred during interaction: {str(e)}")
|