File size: 2,069 Bytes
2223ec6
693bbee
 
 
 
 
 
 
 
 
 
bd67478
693bbee
 
 
 
 
 
 
 
 
 
 
 
 
bc80f7e
 
693bbee
 
 
 
 
 
 
 
 
 
 
 
3525117
693bbee
 
 
 
bc80f7e
 
 
1255b82
 
bc80f7e
 
 
 
 
 
 
1255b82
bc80f7e
 
 
 
 
 
1255b82
bc80f7e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import streamlit as st 






import os
import langchain
import langchain_huggingface
from langchain_huggingface import HuggingFaceEndpoint,HuggingFacePipeline,ChatHuggingFace
from langchain_core.messages import HumanMessage,AIMessage,SystemMessage

deep_seek_skeleton = HuggingFaceEndpoint(repo_id='meta-llama/Llama-3.2-3B-Instruct',
                    provider = 'sambanova',
                    temperature=0.7,
                    max_new_tokens=150,
                    task = 'conversational')
deep_seek = ChatHuggingFace(llm=deep_seek_skeleton,
                    repo_id='meta-llama/Llama-3.2-3B-Instruct',
                    provider = 'sambanova',
                    temperature=0.7,
                    max_new_tokens=150,
                    task = 'conversational')

exp1 = ['<1', '1', '2', '3', '4', '5', '5+']
exp = st.selectbox("Select experience:", exp1)
if exp == '<1':
    experince = 'New bie mentor'
elif exp == '1':
    experince = '1'
elif exp == '2':
    experince = '2'
elif exp == '3':
    experince = '3'
elif exp == '4':
    experince = '4'
elif exp == '5':
    experince = '5'
elif exp == '5+':
    experince = 'professional'




selec = ['Python', 'Machine Learning', 'Deep Learning', 'Statistics', 'SQL', 'Excel']
sub = st.selectbox("Select experience:", selec)





    
user_input = st.text_input("Enter your query:")
l = []
st.write(l)
message = [SystemMessage(content=f'Act as {sub} mentor who has {experince} years of experience and the one who teaches in very friendly manner and also he explains everything within 150 words'),
                   HumanMessage(content=user_input)]
while user_input!='end':
    l.append(user_input)
    l.append(result.content)
    st.write(l)
    user_input = st.text_input("Enter your query:")
    message = [SystemMessage(content=f'Act as {sub} mentor who has {experince} years of experience and the one who teaches in very friendly manner and also he explains everything within 150 words'),
                   HumanMessage(content=user_input)]
    result = deep_seek.invoke(message)