Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,6 @@ from huggingface_hub import login
|
|
| 14 |
# Log in with token
|
| 15 |
login(token=os.getenv("HF_Token"))
|
| 16 |
|
| 17 |
-
|
| 18 |
# Load and preprocess the data
|
| 19 |
def preprocess_data(file_path):
|
| 20 |
"""Load and preprocess the CSV data."""
|
|
@@ -74,7 +73,7 @@ def main_pipeline(file_path, user_query):
|
|
| 74 |
retrieved_text = "\n".join(results['Knowledge_Text'].tolist())
|
| 75 |
|
| 76 |
# Use Llama3.2 for question answering with prompt engineering
|
| 77 |
-
llm = pipeline("text-generation", model="meta-llama/Llama-3.2-1B-Instruct"
|
| 78 |
prompt = (
|
| 79 |
f"You are an expert sports analyst. Based on the following training data, provide a detailed and insightful answer to the user's question. "
|
| 80 |
f"Always include relevant numerical data in your response. Limit your response to a maximum of 200 words.\n\n"
|
|
@@ -109,3 +108,4 @@ interface = gr.Interface(
|
|
| 109 |
)
|
| 110 |
|
| 111 |
interface.launch()
|
|
|
|
|
|
| 14 |
# Log in with token
|
| 15 |
login(token=os.getenv("HF_Token"))
|
| 16 |
|
|
|
|
| 17 |
# Load and preprocess the data
|
| 18 |
def preprocess_data(file_path):
|
| 19 |
"""Load and preprocess the CSV data."""
|
|
|
|
| 73 |
retrieved_text = "\n".join(results['Knowledge_Text'].tolist())
|
| 74 |
|
| 75 |
# Use Llama3.2 for question answering with prompt engineering
|
| 76 |
+
llm = pipeline("text-generation", model="meta-llama/Llama-3.2-1B-Instruct")
|
| 77 |
prompt = (
|
| 78 |
f"You are an expert sports analyst. Based on the following training data, provide a detailed and insightful answer to the user's question. "
|
| 79 |
f"Always include relevant numerical data in your response. Limit your response to a maximum of 200 words.\n\n"
|
|
|
|
| 108 |
)
|
| 109 |
|
| 110 |
interface.launch()
|
| 111 |
+
|