KingNish commited on
Commit
07e84d7
·
verified ·
1 Parent(s): 394ca4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -33
app.py CHANGED
@@ -6,7 +6,6 @@ import edge_tts
6
  import asyncio
7
  import tempfile
8
  import os
9
- import inflect
10
  from huggingface_hub import InferenceClient
11
  import re
12
  import time
@@ -60,21 +59,6 @@ DESCRIPTION = """ # <center><b>JARVIS⚡</b></center>
60
  ### <center>Voice Chat with your personal Assistant</center>
61
  """
62
 
63
- MORE = """ ## TRY Other Models
64
- ### Instant Video: Create Amazing Videos in 5 Second -> https://huggingface.co/spaces/KingNish/Instant-Video
65
- ### Instant Image: 4k images in 5 Second -> https://huggingface.co/spaces/KingNish/Instant-Image
66
- """
67
-
68
- BETA = """ ### Voice Chat (BETA)"""
69
-
70
- FAST = """## Fastest Model"""
71
-
72
- Complex = """## Best in Complex Question"""
73
-
74
- Detail = """## Best for Detailed Generation or Long Answers"""
75
-
76
- base_loaded = "mistralai/Mixtral-8x7B-Instruct-v0.1"
77
-
78
  client1 = InferenceClient(base_loaded)
79
 
80
  system_instructions1 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses as if You are the character Jarvis, made by 'Tony Stark.' The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant. [USER]"
@@ -104,29 +88,15 @@ async def generate1(prompt):
104
  with gr.Blocks(css="style.css") as demo:
105
  gr.Markdown(DESCRIPTION)
106
  with gr.Row():
107
- input = gr.Audio(label="Voice Chat (BETA)", sources="microphone", type="filepath", waveform_options=False)
108
- output = gr.Audio(label="JARVIS", type="filepath",
109
  interactive=False,
110
  autoplay=True,
111
  elem_classes="audio")
112
  gr.Interface(
113
  fn=respond,
114
  inputs=[input],
115
- outputs=[output], live=True)
116
- gr.Markdown(FAST)
117
- with gr.Row():
118
- user_input = gr.Textbox(label="Prompt", value="What is Wikipedia")
119
- input_text = gr.Textbox(label="Input Text", elem_id="important")
120
- output_audio = gr.Audio(label="JARVIS", type="filepath",
121
- interactive=False,
122
- autoplay=True,
123
- elem_classes="audio")
124
- with gr.Row():
125
- translate_btn = gr.Button("Response")
126
- translate_btn.click(fn=generate1, inputs=user_input,
127
- outputs=output_audio, api_name="translate")
128
-
129
- gr.Markdown(MORE)
130
 
131
  if __name__ == "__main__":
132
  demo.queue(max_size=200).launch()
 
6
  import asyncio
7
  import tempfile
8
  import os
 
9
  from huggingface_hub import InferenceClient
10
  import re
11
  import time
 
59
  ### <center>Voice Chat with your personal Assistant</center>
60
  """
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  client1 = InferenceClient(base_loaded)
63
 
64
  system_instructions1 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses as if You are the character Jarvis, made by 'Tony Stark.' The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant. [USER]"
 
88
  with gr.Blocks(css="style.css") as demo:
89
  gr.Markdown(DESCRIPTION)
90
  with gr.Row():
91
+ input = gr.Audio(label="User", sources="microphone", type="filepath", waveform_options=False)
92
+ output = gr.Audio(label="AI", type="filepath",
93
  interactive=False,
94
  autoplay=True,
95
  elem_classes="audio")
96
  gr.Interface(
97
  fn=respond,
98
  inputs=[input],
99
+ outputs=[output], live=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  if __name__ == "__main__":
102
  demo.queue(max_size=200).launch()