fahmiaziz98 commited on
Commit
301cd46
Β·
1 Parent(s): f417379

first commit

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -38,8 +38,8 @@ if model_choice not in st.session_state.downloaded_models:
38
  st.toast(f"βœ… {model_choice} Succesfuly Download!", icon="πŸŽ‰")
39
 
40
  # **1. Sentiment Analysis Model**
41
- if model_choice == "TinyBERT Sentiment Analysis":
42
- text = st.text_area("Enter Text:", "Your review...")
43
  predict = st.button("Predict Sentiment")
44
 
45
  classifier = pipeline("text-classification", model=local_path, device=device)
@@ -51,7 +51,7 @@ if model_choice == "TinyBERT Sentiment Analysis":
51
 
52
  # **2. Disaster Classification**
53
  if model_choice == "TinyBert Disaster Classification":
54
- text = st.text_area("Enter Text:", "Your Tweet...")
55
  predict = st.button("Predict Sentiment")
56
 
57
  classifier = pipeline("text-classification", model=local_path, device=device)
@@ -70,7 +70,7 @@ if model_choice == "VIT Pose Classification":
70
  image = Image.open(uploaded_file)
71
  st.image(image, caption="Your Image", use_column_width=True)
72
 
73
- image_processor = AutoImageProcessor.from_pretrained(local_directory, use_fast=True)
74
  pipe = pipeline('image-classification', model=local_path, image_processor=image_processor, device=device)
75
 
76
  if predict:
 
38
  st.toast(f"βœ… {model_choice} Succesfuly Download!", icon="πŸŽ‰")
39
 
40
  # **1. Sentiment Analysis Model**
41
+ if model_choice == "TinyBert Sentiment Analysis":
42
+ text = st.text_area("Enter Text:", "This movie was horrible, the plot was really boring. acting was okay")
43
  predict = st.button("Predict Sentiment")
44
 
45
  classifier = pipeline("text-classification", model=local_path, device=device)
 
51
 
52
  # **2. Disaster Classification**
53
  if model_choice == "TinyBert Disaster Classification":
54
+ text = st.text_area("Enter Text:", "There is a fire in the building")
55
  predict = st.button("Predict Sentiment")
56
 
57
  classifier = pipeline("text-classification", model=local_path, device=device)
 
70
  image = Image.open(uploaded_file)
71
  st.image(image, caption="Your Image", use_column_width=True)
72
 
73
+ image_processor = AutoImageProcessor.from_pretrained(local_path, use_fast=True)
74
  pipe = pipeline('image-classification', model=local_path, image_processor=image_processor, device=device)
75
 
76
  if predict: