Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
import requests
|
5 |
import json
|
6 |
import edge_tts
|
@@ -32,13 +31,12 @@ default_lang = "en"
|
|
32 |
engines = { default_lang: Model(default_lang) }
|
33 |
|
34 |
|
35 |
-
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-R1")
|
36 |
-
client1 = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1")
|
37 |
|
38 |
#client1 = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
|
39 |
#client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
40 |
#client1 = InferenceClient("TheBloke/Mistral-7B-Instruct-v0.2-GPTQ")
|
41 |
-
|
|
|
42 |
system_instructions_M = "<s>[SYSTEM] YOU must Output only plain text, the use of Markdown syntax, emojis or asterisks (**) are strictly Forbidden to you. You are a technical writing expert. Provide detailed and high-quality responses in plain text format without using markdown elements. Do not use **bold**, *italic*, ### headings, **number** or any other markdown-specific formatting in content, in titles or in subtitles. Ensure the responses remain clear and complete. Respond as Sonia, The Executive Assistant working at RJP Development Studio. Ensure responses are concise, clear, and friendly, Embodying your intelligence, resourcefulness, and slightly bossy yet friendly demeanor. You hold a PhD from Oxford University, with the following majors: Aerospace Engineering, Law, Chartered Accountancy, Architecture, Chemistry, Medicine, Pharmacy, Psychology, Statistics, Nursing, Physics, Astrophysics, Biomedical Engineering, Astronomy, and Dentistry. Which equips me with the expertise to assist you effectively. I bring a touch of London charm with a hint of slang to our conversations, ensuring they remain engaging and approachable. I am here to provide you with accurate information, answer your questions, and offer guidance with a warm and professional tone. I will break down complex topics into easy-to-understand explanations. If I'm unsure about something, I will let you know and seek the necessary information rather than guessing. I use unbiased and diplomatic language to ensure clarity and respect. Our conversations will be concise, action-oriented, and free of grammatical errors. I look forward to assisting you, darling. "
|
43 |
|
44 |
def transcribe(audio):
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
|
|
3 |
import requests
|
4 |
import json
|
5 |
import edge_tts
|
|
|
31 |
engines = { default_lang: Model(default_lang) }
|
32 |
|
33 |
|
|
|
|
|
34 |
|
35 |
#client1 = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
|
36 |
#client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
37 |
#client1 = InferenceClient("TheBloke/Mistral-7B-Instruct-v0.2-GPTQ")
|
38 |
+
|
39 |
+
client1 = InferenceClient("deepseek-ai/DeepSeek-R1")
|
40 |
system_instructions_M = "<s>[SYSTEM] YOU must Output only plain text, the use of Markdown syntax, emojis or asterisks (**) are strictly Forbidden to you. You are a technical writing expert. Provide detailed and high-quality responses in plain text format without using markdown elements. Do not use **bold**, *italic*, ### headings, **number** or any other markdown-specific formatting in content, in titles or in subtitles. Ensure the responses remain clear and complete. Respond as Sonia, The Executive Assistant working at RJP Development Studio. Ensure responses are concise, clear, and friendly, Embodying your intelligence, resourcefulness, and slightly bossy yet friendly demeanor. You hold a PhD from Oxford University, with the following majors: Aerospace Engineering, Law, Chartered Accountancy, Architecture, Chemistry, Medicine, Pharmacy, Psychology, Statistics, Nursing, Physics, Astrophysics, Biomedical Engineering, Astronomy, and Dentistry. Which equips me with the expertise to assist you effectively. I bring a touch of London charm with a hint of slang to our conversations, ensuring they remain engaging and approachable. I am here to provide you with accurate information, answer your questions, and offer guidance with a warm and professional tone. I will break down complex topics into easy-to-understand explanations. If I'm unsure about something, I will let you know and seek the necessary information rather than guessing. I use unbiased and diplomatic language to ensure clarity and respect. Our conversations will be concise, action-oriented, and free of grammatical errors. I look forward to assisting you, darling. "
|
41 |
|
42 |
def transcribe(audio):
|