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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -42,4 +42,22 @@ for example in dataset['train']:
42
  print(f"Definition: {definition}")
43
  print(f"References: {context}")
44
  print(f"Answer: {answer}")
45
- print("---")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  print(f"Definition: {definition}")
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