Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pages/first_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

# Stream inputs from the app. list_inputs give list of dictionaries with inputs and its metadata .
input_obj = User(user_id=userDataObject.user_id).app(app_id=userDataObject.app_id).inputs()
all_inputs = input_obj.list_inputs()
all_inputs = list(input_obj.list_inputs())

#Check for no of inputs in the app and compare it with no of inputs to be displayed.
if len(all_inputs) < (mtotal):
if len((all_inputs)) < (mtotal):
raise Exception(
f"No of inputs is less than {mtotal}. Please add more inputs or reduce the inputs to be displayed !"
)
Expand All @@ -41,9 +41,12 @@
data = []
#added "data_url" which gives the url of the input.
for inp in range(mtotal):
data_url = all_inputs[inp].data.image.url
if len(data_url) < 1:
data_url= all_inputs[inp].data.text.url
data.append({
"id": all_inputs[inp].id,
"data_url": all_inputs[inp].data.image.url,
"data_url": data_url,
"status": all_inputs[inp].status.description,
"created_at": timestamp_pb2.Timestamp.ToDatetime(all_inputs[inp].created_at),
"modified_at": timestamp_pb2.Timestamp.ToDatetime(all_inputs[inp].modified_at),
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
clarifai==9.8.1
clarifai==9.11.0
streamlit==1.24.0