ZongqianLi commited on
Commit
30821be
·
verified ·
1 Parent(s): 6302321

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -1,6 +1,21 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  pipe = pipeline("question-answering", model="ZongqianLi/bert-base-cased-scqa2")
5
 
6
  st.write("Here's our first attempt at using data to create a table:")
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ # 定义一个包含模型名称的列表
5
+ models = [
6
+ "bert-base-uncased",
7
+ "distilbert-base-uncased",
8
+ "roberta-base",
9
+ "gpt2",
10
+ "ZongqianLi/bert-base-cased-scqa2" # 你可以在这里添加更多模型
11
+ ]
12
+
13
+ # 使用st.selectbox创建一个下拉选择框,让用户从列表中选择一个模型
14
+ model = st.selectbox("Choose a model:", models)
15
+
16
+ # 显示用户当前选择的模型
17
+ st.write(f"You selected: {model}")
18
+
19
  pipe = pipeline("question-answering", model="ZongqianLi/bert-base-cased-scqa2")
20
 
21
  st.write("Here's our first attempt at using data to create a table:")