nishantguvvada commited on
Commit
00751c0
·
verified ·
1 Parent(s): 210654a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -0
app.py ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import pandas as pd
3
+
4
+ st.set_page_config(
5
+ page_title="Recommendation System for Agriculture",
6
+ page_icon=":random:",
7
+ layout="centered",
8
+ initial_sidebar_state="expanded",
9
+ menu_items={
10
+ 'About': "# This application will help provide crop recommendations!"
11
+ }
12
+ )
13
+
14
+ #creating session states
15
+ create_session_state()
16
+
17
+ image = Image.open('./image/title.jpg')
18
+ st.image(image)
19
+
20
+ with st.sidebar:
21
+ image = Image.open('./image/sidebar_image.jpg')
22
+ st.image(image)
23
+ st.markdown("<h2 style='text-align: center; color: red;'>Settings Tab</h2>", unsafe_allow_html=True)
24
+
25
+
26
+ st.write("Model Settings:")
27
+
28
+ #define the temeperature for the model
29
+ temperature_value = st.slider('Temperature :', 0.0, 1.0, 0.2)
30
+ st.session_state['temperature'] = temperature_value
31
+
32
+ #define the temeperature for the model
33
+ token_limit_value = st.slider('Token limit :', 1, 1024, 256)
34
+ st.session_state['token_limit'] = token_limit_value
35
+
36
+ #define the temeperature for the model
37
+ top_k_value = st.slider('Top-K :', 1,40,40)
38
+ st.session_state['top_k'] = top_k_value
39
+
40
+ #define the temeperature for the model
41
+ top_p_value = st.slider('Top-P :', 0.0, 1.0, 0.8)
42
+ st.session_state['top_p'] = top_p_value
43
+
44
+ if st.button("Reset Session"):
45
+ reset_session()
46
+
47
+