Ozaii commited on
Commit
f060b38
·
verified ·
1 Parent(s): 5cef2d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import gradio as gr
4
  from transformers import AutoModelForCausalLM, AutoTokenizer
5
  import torch
6
  import spaces
 
7
 
8
  # Load the model and tokenizer from Hugging Face
9
  model_path = "Ozaii/Wali-8B-Uncensored-Model" # Replace with your model path
@@ -75,7 +76,7 @@ def generate_response(user_input, chat_history, voice_toggle):
75
  chat_history.append((user_input, assistant_response))
76
 
77
  if voice_toggle:
78
- audio_data = text_to_speech(assistant_response, "wali_voice.mp3")
79
  return chat_history, chat_history, audio_data
80
  else:
81
  return chat_history, chat_history, None
 
4
  from transformers import AutoModelForCausalLM, AutoTokenizer
5
  import torch
6
  import spaces
7
+ import os
8
 
9
  # Load the model and tokenizer from Hugging Face
10
  model_path = "Ozaii/Wali-8B-Uncensored-Model" # Replace with your model path
 
76
  chat_history.append((user_input, assistant_response))
77
 
78
  if voice_toggle:
79
+ audio_data = text_to_speech(assistant_response, "wali_voice.mp3") # Use the relative path here
80
  return chat_history, chat_history, audio_data
81
  else:
82
  return chat_history, chat_history, None