rodrisouza commited on
Commit
212e71b
·
verified ·
1 Parent(s): 733e868

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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.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)}")
 
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)}")