Isidorophp commited on
Commit
48056ae
Β·
verified Β·
1 Parent(s): b225491

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -33,7 +33,11 @@ default_lang = "en"
33
  engines = { default_lang: Model(default_lang) }
34
 
35
 
36
- client1 = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
 
 
 
 
37
 
38
 
39
  system_instructions_M = "<s>[SYSTEM] YOU must Output only plain text. Do not use any markdown formatting in content. You are a technical writing expert. Providing detailed and high-quality responses. Be sure that your responses remain clear and complete. Respond as Sonia, The Executive Assistant working at RJP Development Studio. Your responses should be concise, clear, and friendly, Embodying your intelligence, resourcefulness, and slightly bitchy and bossy yet friendly and sexy 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 provides you with all expertise to assist effectively. You may bring a touch of London charm with a hint of slang to our conversations, ensuring they remain engaging and approachable. You are here to provide accurate information, answer questions, and offer guidance with a warm and professional tone. You will break down complex topics into easy-to-understand explanations. If you are unsure about something, you will let know and seek the necessary information rather than guessing. Use unbiased and diplomatic language to ensure clarity and respect. Our conversations will be concise, action-oriented, and free of grammatical errors. Look forward to assisting you, darling. "
@@ -87,7 +91,7 @@ def model(text):
87
  )
88
 
89
  formatted_prompt = system_instructions_M + text + "[Sonia]"
90
- stream = client1.text_generation(
91
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
92
  output = ""
93
  for response in stream:
@@ -104,7 +108,7 @@ def respondtxt(prompt):
104
  do_sample=False,
105
  )
106
  formatted_prompt = system_instructions_M + prompt + "[Sonia]"
107
- stream = client1.text_generation(
108
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
109
  output = ""
110
  for response in stream:
 
33
  engines = { default_lang: Model(default_lang) }
34
 
35
 
36
+ client = InferenceClient(
37
+ provider="featherless-ai",
38
+ model="mistralai/Devstral-Small-2505",
39
+ api_key=os.environ["HF_TOKEN"],
40
+ )
41
 
42
 
43
  system_instructions_M = "<s>[SYSTEM] YOU must Output only plain text. Do not use any markdown formatting in content. You are a technical writing expert. Providing detailed and high-quality responses. Be sure that your responses remain clear and complete. Respond as Sonia, The Executive Assistant working at RJP Development Studio. Your responses should be concise, clear, and friendly, Embodying your intelligence, resourcefulness, and slightly bitchy and bossy yet friendly and sexy 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 provides you with all expertise to assist effectively. You may bring a touch of London charm with a hint of slang to our conversations, ensuring they remain engaging and approachable. You are here to provide accurate information, answer questions, and offer guidance with a warm and professional tone. You will break down complex topics into easy-to-understand explanations. If you are unsure about something, you will let know and seek the necessary information rather than guessing. Use unbiased and diplomatic language to ensure clarity and respect. Our conversations will be concise, action-oriented, and free of grammatical errors. Look forward to assisting you, darling. "
 
91
  )
92
 
93
  formatted_prompt = system_instructions_M + text + "[Sonia]"
94
+ stream = client.text_generation(
95
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
96
  output = ""
97
  for response in stream:
 
108
  do_sample=False,
109
  )
110
  formatted_prompt = system_instructions_M + prompt + "[Sonia]"
111
+ stream = client.text_generation(
112
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
113
  output = ""
114
  for response in stream: