nafisehNik commited on
Commit
7e0543d
β€’
1 Parent(s): 08e3335

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -42
app.py CHANGED
@@ -11,6 +11,50 @@ import streamlit as st
11
  import base64
12
 
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  @st.cache_data
15
  def render_svg(svg):
16
  """Renders the given svg string."""
@@ -66,52 +110,10 @@ def compute(sample, top_p, top_k, do_sample, max_length, min_length):
66
 
67
  return postprocess_text
68
 
69
- st.markdown(
70
- """
71
- <style>
72
- [data-testid="stSidebar"][aria-expanded="true"]{
73
- min-width: 450px;
74
- max-width: 450px;
75
- }
76
- """,
77
- unsafe_allow_html=True,
78
- )
79
-
80
-
81
- with st.sidebar:
82
- st.title(" πŸ”§ Settings")
83
-
84
- with st.expander("πŸ— Issue Template Inputs", True):
85
-
86
- in_name = st.text_input("Name Metadata: ", placeholder="e.g., Bug Report or Feqture Request or Question", on_change=None)
87
- in_about = st.text_input("About Metadata: ", placeholder="e.g., File a bug report", on_change=None)
88
- in_title = st.text_input("Title Metadata: ", placeholder="e.g., [Bug]: ", on_change=None)
89
- in_labels = st.text_input("Labels Metadata: ", placeholder="e.g., feature, enhancement", on_change=None)
90
- in_assignees = st.text_input("Assignees Metadata: ", placeholder="e.g., USER_1, USER_2", on_change=None)
91
-
92
- # if no headlines is selected, force the headlines to be empty as well.
93
- option = st.selectbox(
94
- 'How would you like to be Your Heders?',
95
- ('**Emphysis**', '# Header', 'No headlines'))
96
-
97
- in_headlines = st.text_area("Headlines: ", placeholder="Enter each headline in one line.", on_change=None, height=200)
98
- in_summary = st.text_area("Summary: ", placeholder="This Github Issue Template is ...", on_change=None, height=200)
99
-
100
-
101
- with st.expander("πŸŽ› Model Configs", False):
102
- max_length = st.slider("max_length", 30, 512, 300)
103
- min_length = st.slider("min_length", 0, 300, 30)
104
- top_p = st.slider("top_p", 0.0, 1.0, 0.92)
105
- top_k = st.slider("top_k", 0, 100, 0)
106
-
107
-
108
-
109
  st.markdown("[![Duplicate Space](https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14)](https://huggingface.co/spaces/nafisehNik/girt-space?duplicate=true)")
110
 
111
  render_svg(open("assets/logo.svg").read())
112
 
113
-
114
-
115
  tab1, tab2 = st.tabs(["Design GitHub Issue Template", "Manual Prompt"])
116
 
117
  with tab1:
 
11
  import base64
12
 
13
 
14
+ st.markdown(
15
+ """
16
+ <style>
17
+ [data-testid="stSidebar"][aria-expanded="true"]{
18
+ min-width: 450px;
19
+ max-width: 450px;
20
+ }
21
+ """,
22
+ unsafe_allow_html=True)
23
+
24
+
25
+ with st.sidebar:
26
+ st.title(" πŸ”§ Settings")
27
+
28
+ with st.expander("πŸ— Issue Template Inputs", True):
29
+
30
+ in_name = st.text_input("Name Metadata: ", placeholder="e.g., Bug Report or Feqture Request or Question", on_change=None)
31
+ in_about = st.text_input("About Metadata: ", placeholder="e.g., File a bug report", on_change=None)
32
+ in_title = st.text_input("Title Metadata: ", placeholder="e.g., [Bug]: ", on_change=None)
33
+ in_labels = st.text_input("Labels Metadata: ", placeholder="e.g., feature, enhancement", on_change=None)
34
+ in_assignees = st.text_input("Assignees Metadata: ", placeholder="e.g., USER_1, USER_2", on_change=None)
35
+
36
+ # if no headlines is selected, force the headlines to be empty as well.
37
+ option = st.selectbox(
38
+ 'How would you like to be Your Heders?',
39
+ ('**Emphasis**', '# Header', 'No headlines'))
40
+
41
+ in_headlines = st.text_area("Headlines: ", placeholder="Enter each headline in one line.", on_change=None, height=200)
42
+
43
+ df = pd.DataFrame(
44
+ [{"headline": "Welcome"},{"command": "Concise Description"}, {"command": "Additional Info"},])
45
+ in_headlines = st.experimental_data_editor(df, num_rows="dynamic")
46
+
47
+ in_summary = st.text_area("Summary: ", placeholder="This Github Issue Template is ...", on_change=None, height=200)
48
+
49
+
50
+ with st.expander("πŸŽ› Model Configs", False):
51
+ max_length = st.slider("max_length", 30, 512, 300)
52
+ min_length = st.slider("min_length", 0, 300, 30)
53
+ top_p = st.slider("top_p", 0.0, 1.0, 0.92)
54
+ top_k = st.slider("top_k", 0, 100, 0)
55
+
56
+
57
+
58
  @st.cache_data
59
  def render_svg(svg):
60
  """Renders the given svg string."""
 
110
 
111
  return postprocess_text
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  st.markdown("[![Duplicate Space](https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14)](https://huggingface.co/spaces/nafisehNik/girt-space?duplicate=true)")
114
 
115
  render_svg(open("assets/logo.svg").read())
116
 
 
 
117
  tab1, tab2 = st.tabs(["Design GitHub Issue Template", "Manual Prompt"])
118
 
119
  with tab1: