mouadenna commited on
Commit
1c6a810
·
verified ·
1 Parent(s): 41af6a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -36,22 +36,18 @@ tokenizer = AutoTokenizer.from_pretrained("medalpaca/medalpaca-7b")
36
 
37
 
38
  def fn(*args):
39
- global symptoms
40
- all_symptoms = [symptom for symptom_list in args for symptom in symptom_list]
 
 
 
 
 
41
 
42
- if len(all_symptoms) > 17:
43
- raise gr.Error("Please select a maximum of 17 symptoms.")
44
- elif len(all_symptoms) < 3:
45
- raise gr.Error("Please select at least 3 symptoms.")
46
 
47
- symptoms = all_symptoms # Update global symptoms list
48
- return predd(loaded_rf,symptoms)
49
 
50
 
51
 
52
- symptoms = []
53
-
54
-
55
 
56
  demo = gr.Interface(
57
  fn, [
 
36
 
37
 
38
  def fn(*args):
39
+ all_symptoms = [symptom for symptom_list in args for symptom in symptom_list]
40
+ if len(all_symptoms) > 17:
41
+ raise gr.Error("Please select a maximum of 17 symptoms.")
42
+ elif len(all_symptoms) < 3:
43
+ raise gr.Error("Please select at least 3 symptoms.")
44
+ symptoms = all_symptoms # Update global symptoms list
45
+ return predd(loaded_rf,symptoms)
46
 
 
 
 
 
47
 
 
 
48
 
49
 
50
 
 
 
 
51
 
52
  demo = gr.Interface(
53
  fn, [