Raiff1982 commited on
Commit
fd3c102
·
verified ·
1 Parent(s): e02eafb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -16,7 +16,7 @@ for gpu in gpus:
16
  try:
17
  tf.config.experimental.set_memory_growth(gpu, True)
18
  except RuntimeError as e:
19
- print(f"[TF] GPU memory growth config error: {e}")
20
  # Initialize AI Core for TB analysis
21
  ai_core = AICoreAGIX()
22
 
@@ -39,14 +39,14 @@ async def diagnose_tb_async(image_file, audio_file):
39
  pass
40
 
41
  return (
42
- f"**TB Risk Level:** {result['tb_risk']}\n\n"
43
- f"**Image Result:** {result['image_analysis']['result']} "
44
- f"(Confidence: {result['image_analysis']['confidence']:.2f})\n\n"
45
- f"**Audio Result:** {result['audio_analysis']['result']} "
46
- f"(Confidence: {result['audio_analysis']['confidence']:.2f})\n\n"
47
- f"**Ethical Analysis:** {result['ethical_analysis']}\n\n"
48
- f"**Explanation:** {result['explanation']}\n\n"
49
- f"**Shareable Link:** {result['shareable_link']}"
50
  )
51
 
52
  def diagnose_tb(image_file, audio_file):
@@ -56,7 +56,7 @@ def upload_and_finetune(jsonl_file):
56
  if jsonl_file is None:
57
  return "Please upload a .jsonl file to fine-tune Codriao."
58
 
59
- save_path = f"./training_data/{jsonl_file.name}"
60
  os.makedirs("training_data", exist_ok=True)
61
 
62
  with open(save_path, "wb") as f:
@@ -71,7 +71,7 @@ def upload_and_finetune(jsonl_file):
71
  except:
72
  pass
73
 
74
- return "✅ Fine-tuning complete! Model updated and stored."
75
 
76
  def get_latest_model():
77
  return "Download the latest fine-tuned Codriao model here: https://huggingface.co/Raiff1982/codriao-finetuned"
 
16
  try:
17
  tf.config.experimental.set_memory_growth(gpu, True)
18
  except RuntimeError as e:
19
+ print("[TF] GPU memory growth config error: {e}")
20
  # Initialize AI Core for TB analysis
21
  ai_core = AICoreAGIX()
22
 
 
39
  pass
40
 
41
  return (
42
+ "**TB Risk Level:** {result['tb_risk']}\n\n"
43
+ "**Image Result:** {result['image_analysis']['result']} "
44
+ "(Confidence: {result['image_analysis']['confidence']:.2f})\n\n"
45
+ "**Audio Result:** {result['audio_analysis']['result']} "
46
+ "(Confidence: {result['audio_analysis']['confidence']:.2f})\n\n"
47
+ "**Ethical Analysis:** {result['ethical_analysis']}\n\n"
48
+ "**Explanation:** {result['explanation']}\n\n"
49
+ "**Shareable Link:** {result['shareable_link']}"
50
  )
51
 
52
  def diagnose_tb(image_file, audio_file):
 
56
  if jsonl_file is None:
57
  return "Please upload a .jsonl file to fine-tune Codriao."
58
 
59
+ save_path = "./training_data/{jsonl_file.name}"
60
  os.makedirs("training_data", exist_ok=True)
61
 
62
  with open(save_path, "wb") as f:
 
71
  except:
72
  pass
73
 
74
+ return "œ… Fine-tuning complete! Model updated and stored."
75
 
76
  def get_latest_model():
77
  return "Download the latest fine-tuned Codriao model here: https://huggingface.co/Raiff1982/codriao-finetuned"