Spaces:
Sleeping
Sleeping
Update pages/python.py
Browse files- pages/python.py +38 -5
pages/python.py
CHANGED
|
@@ -23,8 +23,8 @@ deep_seek = ChatHuggingFace(llm=deep_seek_skeleton,
|
|
| 23 |
max_new_tokens=150,
|
| 24 |
task = 'conversational')
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
if exp == '<1':
|
| 29 |
experince = 'New bie mentor'
|
| 30 |
elif exp == '1':
|
|
@@ -39,9 +39,42 @@ elif exp == '5':
|
|
| 39 |
experince = '5'
|
| 40 |
elif exp == '5+':
|
| 41 |
experince = 'professional'
|
| 42 |
-
user_input = st.text_input("Enter your query:")
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
max_new_tokens=150,
|
| 24 |
task = 'conversational')
|
| 25 |
|
| 26 |
+
exp1 = ['<1', '1', '2', '3', '4', '5', '5+']
|
| 27 |
+
exp = st.selectbox("Select experience:", exp1)
|
| 28 |
if exp == '<1':
|
| 29 |
experince = 'New bie mentor'
|
| 30 |
elif exp == '1':
|
|
|
|
| 39 |
experince = '5'
|
| 40 |
elif exp == '5+':
|
| 41 |
experince = 'professional'
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
+
|
| 46 |
+
selec = ['Python', 'Machine Learning', 'Deep Learning', 'Statistics', 'SQL', 'Excel']
|
| 47 |
+
sub = st.selectbox("Select experience:", selec)
|
| 48 |
+
if sub == '<1':
|
| 49 |
+
subject = 'New bie mentor'
|
| 50 |
+
elif sub == '1':
|
| 51 |
+
subject = '1'
|
| 52 |
+
elif sub == '2':
|
| 53 |
+
subject = '2'
|
| 54 |
+
elif sub == '3':
|
| 55 |
+
subject = '3'
|
| 56 |
+
elif sub == '4':
|
| 57 |
+
subject = '4'
|
| 58 |
+
elif sub == '5':
|
| 59 |
+
subject = '5'
|
| 60 |
+
elif sub == '5+':
|
| 61 |
+
subject = 'professional'
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
user_input = st.text_input("Enter your query:")
|
| 67 |
+
l = []
|
| 68 |
+
st.write(l)
|
| 69 |
+
message = [SystemMessage(content=f'Act as {subject} mentor who has {experince} years of experience and the one who teaches in very friendly manner and also he explains everything within 150 words'),
|
| 70 |
+
HumanMessage(content=user_input)]
|
| 71 |
+
while user_input!='end':
|
| 72 |
+
l.append(user_input)
|
| 73 |
+
l.append(result.content)
|
| 74 |
+
st.write(l)
|
| 75 |
+
user_input = st.text_input("Enter your query:")
|
| 76 |
+
message = [SystemMessage(content=f'Act as {subject} mentor who has {experince} years of experience and the one who teaches in very friendly manner and also he explains everything within 150 words'),
|
| 77 |
+
HumanMessage(content=user_input)]
|
| 78 |
+
result = deep_seek.invoke(message)
|
| 79 |
+
|
| 80 |
+
|