SkwarczynskiP commited on
Commit
53f6ffb
·
verified ·
1 Parent(s): 691e7be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ exampleDatasets = ["No Dataset Finetuning",
47
  examples = [[random.choice(exampleModels), random.choice(exampleDatasets), random.choice(exampleText)] for example in exampleText]
48
 
49
 
50
- def detect_ai_generated_text(model: str, dataset: str, text: str) -> dict:
51
  # Get the fine-tuned model using mapping
52
  finetuned_model = model_mapping.get((model, dataset))
53
 
@@ -69,7 +69,7 @@ def detect_ai_generated_text(model: str, dataset: str, text: str) -> dict:
69
  ai_bar = f'<div style="background-color: red; width: {ai_score * 100}%; height: 20px;"></div>'
70
  human_bar = f'<div style="background-color: blue; width: {human_score * 100}%; height: 20px;"></div>'
71
 
72
- return {"label": f"{label} with confidence {score * 100:.2f}%", "ai_bar": ai_bar, "human_bar": human_bar}
73
 
74
 
75
  interface = gr.Interface(
 
47
  examples = [[random.choice(exampleModels), random.choice(exampleDatasets), random.choice(exampleText)] for example in exampleText]
48
 
49
 
50
+ def detect_ai_generated_text(model: str, dataset: str, text: str) -> list:
51
  # Get the fine-tuned model using mapping
52
  finetuned_model = model_mapping.get((model, dataset))
53
 
 
69
  ai_bar = f'<div style="background-color: red; width: {ai_score * 100}%; height: 20px;"></div>'
70
  human_bar = f'<div style="background-color: blue; width: {human_score * 100}%; height: 20px;"></div>'
71
 
72
+ return [f"{label} with confidence {score * 100:.2f}%", ai_bar, human_bar]
73
 
74
 
75
  interface = gr.Interface(