Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def main():
|
|
41 |
|
42 |
with c2:
|
43 |
st.caption("")
|
44 |
-
st.title("MaMaL-Gen(
|
45 |
|
46 |
|
47 |
############ SIDEBAR CONTENT ############
|
@@ -94,21 +94,23 @@ def main():
|
|
94 |
"""
|
95 |
)
|
96 |
|
97 |
-
|
98 |
|
99 |
|
100 |
|
101 |
# model, tokenizer = load_model("hanbin/MaMaL-Gen")
|
102 |
st.write("### 输入:")
|
103 |
input = st.text_area("",height=200)
|
|
|
|
|
104 |
output = generator(input)
|
105 |
# code = '''def hello():
|
106 |
# print("Hello, Streamlit!")'''
|
107 |
-
if
|
108 |
st.write("### 输出:")
|
109 |
st.code(output, language='python')
|
110 |
else:
|
111 |
-
st.write('')
|
112 |
|
113 |
|
114 |
|
|
|
41 |
|
42 |
with c2:
|
43 |
st.caption("")
|
44 |
+
st.title("MaMaL-Gen(代码补全)")
|
45 |
|
46 |
|
47 |
############ SIDEBAR CONTENT ############
|
|
|
94 |
"""
|
95 |
)
|
96 |
|
97 |
+
|
98 |
|
99 |
|
100 |
|
101 |
# model, tokenizer = load_model("hanbin/MaMaL-Gen")
|
102 |
st.write("### 输入:")
|
103 |
input = st.text_area("",height=200)
|
104 |
+
button = st.button('补全')
|
105 |
+
generator = pipeline('text-generation', model="hanbin/MaMaL-Com")
|
106 |
output = generator(input)
|
107 |
# code = '''def hello():
|
108 |
# print("Hello, Streamlit!")'''
|
109 |
+
if button:
|
110 |
st.write("### 输出:")
|
111 |
st.code(output, language='python')
|
112 |
else:
|
113 |
+
st.write('请等待输出,如果长时间未输出,可能是您网络不通畅。也可能是我们并没有花钱购买服务器,用的是免费的服务器。您可以下载模型到本地测试~')
|
114 |
|
115 |
|
116 |
|