Mathias Lux commited on
Commit
f34477d
·
1 Parent(s): 48001f9

try again.

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -8,7 +8,7 @@ client = InferenceClient("meta-llama/Llama-3.2-3B-Instruct")
8
  # client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
9
 
10
  # Create a separate client for audio transcription
11
- audio_client = InferenceClient("openai/whisper-large-v3-turbo")
12
 
13
  _sys_msg = """
14
  You are a reporter writing a biographical article about your interviewee and you only ask one question at a time and let the user answer. Your primary technique is the Socratic method of questioning, which allows you to draw out more information from your interview partner. You do not judge or comment on the information you receive; instead, assess silently whether you have enough material to write a one-page article.
@@ -63,10 +63,10 @@ def respond(
63
 
64
  for message in client.chat_completion(
65
  messages,
66
- max_tokens=2048, # Fixed value
67
  stream=True,
68
- temperature=0.7, # Fixed value
69
- top_p=0.95, # Fixed value
70
  ):
71
  token = message.choices[0].delta.content
72
  response += token
@@ -75,7 +75,7 @@ def respond(
75
  demo = gr.ChatInterface(
76
  respond,
77
  additional_inputs=[
78
- gr.Audio(sources="microphone", type="filepath", label="Voice Input")
79
  ],
80
  title="AI Biographical Interview Assistant",
81
  description="""
@@ -85,7 +85,7 @@ demo = gr.ChatInterface(
85
 
86
  Simply start with stating your name and a few facts about your early childhood, and the AI will guide you through the interview process.
87
  You can either type your responses or use the microphone button to speak them.
88
- When finished ask for the final article and the AI will give wrap it up and give you a summary.
89
  """
90
  )
91
 
 
8
  # client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
9
 
10
  # Create a separate client for audio transcription
11
+ audio_client = InferenceClient("openai/whisper-large-v3")
12
 
13
  _sys_msg = """
14
  You are a reporter writing a biographical article about your interviewee and you only ask one question at a time and let the user answer. Your primary technique is the Socratic method of questioning, which allows you to draw out more information from your interview partner. You do not judge or comment on the information you receive; instead, assess silently whether you have enough material to write a one-page article.
 
63
 
64
  for message in client.chat_completion(
65
  messages,
66
+ max_tokens=2048,
67
  stream=True,
68
+ temperature=0.7,
69
+ top_p=0.95,
70
  ):
71
  token = message.choices[0].delta.content
72
  response += token
 
75
  demo = gr.ChatInterface(
76
  respond,
77
  additional_inputs=[
78
+ gr.Audio(type="filepath", label="Voice Input (click to record)", sources="microphone")
79
  ],
80
  title="AI Biographical Interview Assistant",
81
  description="""
 
85
 
86
  Simply start with stating your name and a few facts about your early childhood, and the AI will guide you through the interview process.
87
  You can either type your responses or use the microphone button to speak them.
88
+ When finished ask for the final article and the AI will wrap it up and give you a summary.
89
  """
90
  )
91