Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,18 +38,27 @@ class LLM_Langchain():
|
|
38 |
value=120,
|
39 |
help="Set the max tokens to get accurate results"
|
40 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
self.top_k = st.sidebar.slider(
|
43 |
-
label="
|
44 |
-
min_value=1
|
45 |
-
max_value=50
|
46 |
-
step=1
|
47 |
-
value=30
|
48 |
help="Set the top_k"
|
49 |
)
|
50 |
|
51 |
self.top_p = st.sidebar.slider(
|
52 |
-
label="
|
53 |
min_value=0.1,
|
54 |
max_value=1.0,
|
55 |
step=0.05,
|
@@ -61,7 +70,8 @@ class LLM_Langchain():
|
|
61 |
self.model_kwargs = {
|
62 |
"max_new_tokens": self.max_new_tokens,
|
63 |
"top_k": self.top_k,
|
64 |
-
"top_p": self.top_p
|
|
|
65 |
}
|
66 |
|
67 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = self.API_KEY
|
|
|
38 |
value=120,
|
39 |
help="Set the max tokens to get accurate results"
|
40 |
)
|
41 |
+
|
42 |
+
self.num_beams = st.sidebar.slider(
|
43 |
+
label="num beams",
|
44 |
+
min_value=1,
|
45 |
+
max_value=10,
|
46 |
+
step=1,
|
47 |
+
value=4,
|
48 |
+
help="Set num beam"
|
49 |
+
)
|
50 |
|
51 |
self.top_k = st.sidebar.slider(
|
52 |
+
label="top k",
|
53 |
+
min_value=1,
|
54 |
+
max_value=50,
|
55 |
+
step=1,
|
56 |
+
value=30,
|
57 |
help="Set the top_k"
|
58 |
)
|
59 |
|
60 |
self.top_p = st.sidebar.slider(
|
61 |
+
label="top p",
|
62 |
min_value=0.1,
|
63 |
max_value=1.0,
|
64 |
step=0.05,
|
|
|
70 |
self.model_kwargs = {
|
71 |
"max_new_tokens": self.max_new_tokens,
|
72 |
"top_k": self.top_k,
|
73 |
+
"top_p": self.top_p,
|
74 |
+
"num_beams": self.num_beams
|
75 |
}
|
76 |
|
77 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = self.API_KEY
|