Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- .idea/workspace.xml +6 -16
- main.py +1 -2
.idea/workspace.xml
CHANGED
@@ -32,13 +32,13 @@
|
|
32 |
<option name="hideEmptyMiddlePackages" value="true" />
|
33 |
<option name="showLibraryContents" value="true" />
|
34 |
</component>
|
35 |
-
<component name="PropertiesComponent"
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
}
|
41 |
-
}
|
42 |
<component name="RunManager">
|
43 |
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
44 |
<module name="gradioapp" />
|
@@ -84,21 +84,11 @@
|
|
84 |
<component name="XDebuggerManager">
|
85 |
<breakpoint-manager>
|
86 |
<breakpoints>
|
87 |
-
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
88 |
-
<url>file://$PROJECT_DIR$/main.py</url>
|
89 |
-
<line>47</line>
|
90 |
-
<option name="timeStamp" value="2" />
|
91 |
-
</line-breakpoint>
|
92 |
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
93 |
<url>file://$PROJECT_DIR$/main.py</url>
|
94 |
<line>25</line>
|
95 |
<option name="timeStamp" value="3" />
|
96 |
</line-breakpoint>
|
97 |
-
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
98 |
-
<url>file://$PROJECT_DIR$/main.py</url>
|
99 |
-
<line>49</line>
|
100 |
-
<option name="timeStamp" value="4" />
|
101 |
-
</line-breakpoint>
|
102 |
</breakpoints>
|
103 |
</breakpoint-manager>
|
104 |
<watches-manager>
|
|
|
32 |
<option name="hideEmptyMiddlePackages" value="true" />
|
33 |
<option name="showLibraryContents" value="true" />
|
34 |
</component>
|
35 |
+
<component name="PropertiesComponent">{
|
36 |
+
"keyToString": {
|
37 |
+
"Python.main.executor": "Run",
|
38 |
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
39 |
+
"settings.editor.selected.configurable": "preferences.pluginManager"
|
40 |
}
|
41 |
+
}</component>
|
42 |
<component name="RunManager">
|
43 |
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
44 |
<module name="gradioapp" />
|
|
|
84 |
<component name="XDebuggerManager">
|
85 |
<breakpoint-manager>
|
86 |
<breakpoints>
|
|
|
|
|
|
|
|
|
|
|
87 |
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
88 |
<url>file://$PROJECT_DIR$/main.py</url>
|
89 |
<line>25</line>
|
90 |
<option name="timeStamp" value="3" />
|
91 |
</line-breakpoint>
|
|
|
|
|
|
|
|
|
|
|
92 |
</breakpoints>
|
93 |
</breakpoint-manager>
|
94 |
<watches-manager>
|
main.py
CHANGED
@@ -45,7 +45,6 @@ def chatwith_qwen2_1point5b_instruct(prompt, max_newtokens):
|
|
45 |
|
46 |
pipe = pipeline(task="text-generation", model="Qwen/Qwen2-1.5B-Instruct")
|
47 |
|
48 |
-
|
49 |
def chatbot_handler(user_message, history):
|
50 |
bot_response = "I don't think so"
|
51 |
messages = []
|
@@ -61,7 +60,7 @@ def chatbot_handler(user_message, history):
|
|
61 |
messages.append(user_message)
|
62 |
|
63 |
print(f"messages before sending to model {messages}")
|
64 |
-
messages = pipe(messages, max_new_tokens=
|
65 |
print(f"messages after sending to model{messages}")
|
66 |
|
67 |
if messages:
|
|
|
45 |
|
46 |
pipe = pipeline(task="text-generation", model="Qwen/Qwen2-1.5B-Instruct")
|
47 |
|
|
|
48 |
def chatbot_handler(user_message, history):
|
49 |
bot_response = "I don't think so"
|
50 |
messages = []
|
|
|
60 |
messages.append(user_message)
|
61 |
|
62 |
print(f"messages before sending to model {messages}")
|
63 |
+
messages = pipe(messages, max_new_tokens=512)[0]['generated_text']
|
64 |
print(f"messages after sending to model{messages}")
|
65 |
|
66 |
if messages:
|