shreyanshjha0709 commited on
Commit
bf2578c
·
verified ·
1 Parent(s): 5d087ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- import json
3
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
4
 
5
  # Load model and tokenizer
@@ -11,14 +11,15 @@ def load_model():
11
 
12
  model, tokenizer = load_model()
13
 
14
- # Load the JSON file
15
  @st.cache_data
16
- def load_json():
17
- with open('watches_data.json') as f: # Your JSON file name
18
- data = json.load(f)
19
- return data
20
 
21
- data = load_json()
 
 
22
 
23
  # Extract unique brands
24
  brands = sorted(list(set([item["brand"] for item in data])))
 
1
  import streamlit as st
2
+ import requests
3
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
4
 
5
  # Load model and tokenizer
 
11
 
12
  model, tokenizer = load_model()
13
 
14
+ # Load the JSON file from a URL
15
  @st.cache_data
16
+ def load_json_from_url(url):
17
+ response = requests.get(url)
18
+ return response.json()
 
19
 
20
+ # Provide your JSON URL here
21
+ json_url = "https://www.ethoswatches.com/feeds/holbox_ai.json"
22
+ data = load_json_from_url(json_url)
23
 
24
  # Extract unique brands
25
  brands = sorted(list(set([item["brand"] for item in data])))