Lexim011 commited on
Commit
faadec8
·
verified ·
1 Parent(s): 58e6151

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -20
app.py CHANGED
@@ -1,7 +1,20 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
5
 
6
  from transformers import T5ForConditionalGeneration, T5Tokenizer
7
  from datasets import load_dataset
@@ -43,21 +56,3 @@ for example in dataset['train']:
43
  print(f"References: {context}")
44
  print(f"Answer: {answer}")
45
  print("---")
46
-
47
- import streamlit as st
48
- from datasets import load_dataset
49
-
50
- # Existing Streamlit logic
51
- st.title('My Streamlit App')
52
- st.write('Welcome to my app!')
53
-
54
- # Load your dataset
55
- dataset = load_dataset('csv', data_files='CCI_Details_Structured_Full.csv')
56
-
57
- # Streamlit widget for user input
58
- contributor_query = st.text_input('Enter Contributor to search:')
59
-
60
- # Run the query based on the widget input
61
- if contributor_query:
62
- results = [example for example in dataset['train'] if example['Contributor'].lower() == contributor_query.lower()]
63
- st.write(results) # Display the results
 
1
  import streamlit as st
2
+ from datasets import load_dataset
3
+
4
+ # Existing Streamlit logic
5
+ st.title('My Streamlit App')
6
+ st.write('Welcome to my app!')
7
+
8
+ # Load your dataset
9
+ dataset = load_dataset('csv', data_files='CCI_Details_Structured_Full.csv')
10
 
11
+ # Streamlit widget for user input
12
+ contributor_query = st.text_input('Enter Contributor to search:')
13
+
14
+ # Run the query based on the widget input
15
+ if contributor_query:
16
+ results = [example for example in dataset['train'] if example['Contributor'].lower() == contributor_query.lower()]
17
+ st.write(results) # Display the results
18
 
19
  from transformers import T5ForConditionalGeneration, T5Tokenizer
20
  from datasets import load_dataset
 
56
  print(f"References: {context}")
57
  print(f"Answer: {answer}")
58
  print("---")