Spaces:
Sleeping
Sleeping
Update huggingfaceModel.py
Browse files- huggingfaceModel.py +8 -8
huggingfaceModel.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
-
def generate_dropout_insights(input_values, risk_factors):
|
| 5 |
"""
|
| 6 |
Generates structured dropout risk insights using AI, ensuring Unicode-safe text for PDFs.
|
| 7 |
"""
|
|
@@ -20,29 +20,29 @@ def generate_dropout_insights(input_values, risk_factors):
|
|
| 20 |
{
|
| 21 |
"role": "user",
|
| 22 |
"content": f"""
|
| 23 |
-
Generate a
|
| 24 |
|
| 25 |
{formatted_input}
|
| 26 |
|
| 27 |
Format the response as:
|
| 28 |
|
| 29 |
-
##
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
###
|
| 34 |
List areas where the student is performing well:
|
| 35 |
{{strengths}}
|
| 36 |
|
| 37 |
-
###
|
| 38 |
Identify factors that increase dropout risk:
|
| 39 |
{{concerns}}
|
| 40 |
|
| 41 |
-
###
|
| 42 |
Provide targeted **solutions** based on the student's **weak areas**:
|
| 43 |
{{recommendations}}
|
| 44 |
|
| 45 |
-
##
|
| 46 |
{{overall_recommendation}}
|
| 47 |
"""
|
| 48 |
}
|
|
|
|
| 1 |
import os
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
+
def generate_dropout_insights(input_values, risk_factors, label):
|
| 5 |
"""
|
| 6 |
Generates structured dropout risk insights using AI, ensuring Unicode-safe text for PDFs.
|
| 7 |
"""
|
|
|
|
| 20 |
{
|
| 21 |
"role": "user",
|
| 22 |
"content": f"""
|
| 23 |
+
Generate a detailed dropout risk analysis report based on the following data:
|
| 24 |
|
| 25 |
{formatted_input}
|
| 26 |
|
| 27 |
Format the response as:
|
| 28 |
|
| 29 |
+
## Analysis of Student Dropout Risk
|
| 30 |
|
| 31 |
+
Overall Risk Level: {label}
|
| 32 |
|
| 33 |
+
### π’ Strengths:
|
| 34 |
List areas where the student is performing well:
|
| 35 |
{{strengths}}
|
| 36 |
|
| 37 |
+
### π΄ Concerns:
|
| 38 |
Identify factors that increase dropout risk:
|
| 39 |
{{concerns}}
|
| 40 |
|
| 41 |
+
### π Action Plan for Improvement:
|
| 42 |
Provide targeted **solutions** based on the student's **weak areas**:
|
| 43 |
{{recommendations}}
|
| 44 |
|
| 45 |
+
## π Final Recommendation:
|
| 46 |
{{overall_recommendation}}
|
| 47 |
"""
|
| 48 |
}
|