fourth Commit
Browse files
app.py
CHANGED
@@ -1,25 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
-
# Load your LLaMA model
|
7 |
-
model = gr.load("models/meta-llama/Meta-Llama-3.1-8B-Instruct")
|
8 |
-
|
9 |
-
# Define a function to detect sarcasm
|
10 |
-
def detect_sarcasm(input_text):
|
11 |
-
prompt = f"Determine if the following text contains sarcasm: '{input_text}'"
|
12 |
-
response = model.generate(prompt, max_tokens=50)
|
13 |
-
return response['choices'][0]['text'].strip()
|
14 |
-
|
15 |
-
# Create a Gradio interface
|
16 |
-
interface = gr.Interface(
|
17 |
-
fn=detect_sarcasm,
|
18 |
-
inputs="text",
|
19 |
-
outputs="text",
|
20 |
-
title="Sarcasm Detector",
|
21 |
-
description="Enter a sentence to check if it contains sarcasm."
|
22 |
-
)
|
23 |
-
|
24 |
-
# Launch the app
|
25 |
-
interface.launch()
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
gr.load("models/meta-llama/Meta-Llama-3.1-8B-Instruct").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|