Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,26 +3,16 @@ from huggingface_hub import InferenceClient
|
|
| 3 |
|
| 4 |
client = InferenceClient("Intercept-Intelligence/Txt-Analyst-AI")
|
| 5 |
|
| 6 |
-
def classify(text
|
| 7 |
-
result = client.
|
| 8 |
-
|
| 9 |
-
max_tokens=max_tokens,
|
| 10 |
-
temperature=temperature,
|
| 11 |
-
top_p=top_p,
|
| 12 |
-
)
|
| 13 |
-
return result
|
| 14 |
|
| 15 |
demo = gr.Interface(
|
| 16 |
fn=classify,
|
| 17 |
-
inputs=
|
| 18 |
-
gr.Textbox(label="Text to Analyze", placeholder="Enter text here..."),
|
| 19 |
-
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max tokens"),
|
| 20 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 21 |
-
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p"),
|
| 22 |
-
],
|
| 23 |
outputs=gr.Textbox(label="Classification Result"),
|
| 24 |
title="Txt Analyst AI",
|
| 25 |
-
description="Enter any text and let Intercept's AI classify
|
| 26 |
)
|
| 27 |
|
| 28 |
if __name__ == "__main__":
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient("Intercept-Intelligence/Txt-Analyst-AI")
|
| 5 |
|
| 6 |
+
def classify(text):
|
| 7 |
+
result = client.text_classification(text)
|
| 8 |
+
return result[0]["label"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
demo = gr.Interface(
|
| 11 |
fn=classify,
|
| 12 |
+
inputs=gr.Textbox(label="Text to Analyze", placeholder="Enter text here..."),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
outputs=gr.Textbox(label="Classification Result"),
|
| 14 |
title="Txt Analyst AI",
|
| 15 |
+
description="Enter any text and let Intercept's AI classify it based on its training."
|
| 16 |
)
|
| 17 |
|
| 18 |
if __name__ == "__main__":
|