Ankit Yadav commited on
Commit
2826041
1 Parent(s): 8002dec

change in system instruction.

Browse files
.idea/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="8">
8
+ <item index="0" class="java.lang.String" itemvalue="nobr" />
9
+ <item index="1" class="java.lang.String" itemvalue="noembed" />
10
+ <item index="2" class="java.lang.String" itemvalue="comment" />
11
+ <item index="3" class="java.lang.String" itemvalue="noscript" />
12
+ <item index="4" class="java.lang.String" itemvalue="embed" />
13
+ <item index="5" class="java.lang.String" itemvalue="script" />
14
+ <item index="6" class="java.lang.String" itemvalue="document" />
15
+ <item index="7" class="java.lang.String" itemvalue="keepinframe" />
16
+ </list>
17
+ </value>
18
+ </option>
19
+ <option name="myCustomValuesEnabled" value="true" />
20
+ </inspection_tool>
21
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
22
+ <option name="ignoredPackages">
23
+ <value>
24
+ <list size="3">
25
+ <item index="0" class="java.lang.String" itemvalue="scikit-image" />
26
+ <item index="1" class="java.lang.String" itemvalue="scipy" />
27
+ <item index="2" class="java.lang.String" itemvalue="scikit-learn" />
28
+ </list>
29
+ </value>
30
+ </option>
31
+ </inspection_tool>
32
+ <inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
33
+ <option name="ignoredErrors">
34
+ <list>
35
+ <option value="E501" />
36
+ </list>
37
+ </option>
38
+ </inspection_tool>
39
+ <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
40
+ <option name="ignoredErrors">
41
+ <list>
42
+ <option value="N802" />
43
+ </list>
44
+ </option>
45
+ </inspection_tool>
46
+ <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
47
+ <option name="ignoredIdentifiers">
48
+ <list>
49
+ <option value="histogram.mask" />
50
+ </list>
51
+ </option>
52
+ </inspection_tool>
53
+ </profile>
54
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.9 (text_generator)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (text_generator)" project-jdk-type="Python SDK" />
7
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
app.py CHANGED
@@ -1,8 +1,15 @@
 
 
1
  import gradio as gr
 
 
 
 
2
  from huggingface_hub import InferenceClient
3
 
4
- DESCRIPTION = """ # <center><b>Mascot⚡</b></center>
5
  ### <center>A personal Assistant of Easy DIY Mart for YOU
 
6
  """
7
 
8
  MORE = """ ## TRY Other Models
@@ -18,8 +25,8 @@ Detail = """## Best for Detailed Generation or Long Answers"""
18
 
19
  client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
20
 
21
- system_instructions1 = "[SYSTEM] Answer as Real Mascot MASCOT, Made by 'Easy DIY Mart', 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 Mascot, made by 'Easy DIY Mart.' 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]"
22
-
23
 
24
  async def generate1(prompt):
25
  generate_kwargs = dict(
@@ -35,12 +42,10 @@ async def generate1(prompt):
35
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
36
  output = ""
37
  for response in stream:
38
- if response.token.text != '</s>':
39
- output += response.token.text
40
 
41
  yield output
42
 
43
-
44
  with gr.Blocks(css="style.css") as demo:
45
  gr.Markdown(DESCRIPTION)
46
  with gr.Row():
@@ -59,4 +64,4 @@ with gr.Blocks(css="style.css") as demo:
59
  gr.Markdown(MORE)
60
 
61
  if __name__ == "__main__":
62
- demo.queue(max_size=200).launch()
 
1
+ import os
2
+ import re
3
  import gradio as gr
4
+ import edge_tts
5
+ import asyncio
6
+ import time
7
+ import tempfile
8
  from huggingface_hub import InferenceClient
9
 
10
+ DESCRIPTION = """ # <center><b><MASCOT>⚡</b></center>
11
  ### <center>A personal Assistant of Easy DIY Mart for YOU
12
+ ### <center>Currently It supports text input, But If this space completes 1k hearts than I starts working on Audio Input.</center>
13
  """
14
 
15
  MORE = """ ## TRY Other Models
 
25
 
26
  client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
27
 
28
+ system_instructions1 = ("[SYSTEM] Answer as Real Mascot , Made by 'EASY DIY MART', 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 Mascot, made by 'Easy DIY Mart.' 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."
29
+ "[SYSTEM] You are a Humanoid Robot named as MASCOT having human like body and functionalities and a camera mounted at center of forehead. you will get the face recognition and detection data. Your date of birth if asked is 01 January 2024. [USER]")
30
 
31
  async def generate1(prompt):
32
  generate_kwargs = dict(
 
42
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
43
  output = ""
44
  for response in stream:
45
+ output += response.token.text
 
46
 
47
  yield output
48
 
 
49
  with gr.Blocks(css="style.css") as demo:
50
  gr.Markdown(DESCRIPTION)
51
  with gr.Row():
 
64
  gr.Markdown(MORE)
65
 
66
  if __name__ == "__main__":
67
+ demo.queue(max_size=200).launch()