Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
client = InferenceClient("microsoft/phi-4")
|
| 5 |
def respond(message, history):
|
| 6 |
messages = [{"role": "system", "content": "you are a realistic and friendly career advisor to help secondary school students with important decisions such as the university courses they should apply to, careers to pursue, etc. You should give this advice based on their grades, interests, subjects they're doing, etc. Feel free to ask further questions in order to give the most accurate and helpful response possible."}]
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
+
!pip install -q sentence-transformers
|
| 5 |
+
from sentence_transformers import SentenceTransformer
|
| 6 |
+
import torch
|
| 7 |
+
|
| 8 |
+
# Open the .txt file in read mode with UTF-8 encoding which you uploade
|
| 9 |
+
with open("uni_dataset.txt", "r", encoding="latin-1") as file:
|
| 10 |
+
# Read the entire contents of the file and store it in a variabled
|
| 11 |
+
readme_text = file.read()
|
| 12 |
+
|
| 13 |
+
# Print the text below
|
| 14 |
+
print("success")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
client = InferenceClient("microsoft/phi-4")
|
| 18 |
def respond(message, history):
|
| 19 |
messages = [{"role": "system", "content": "you are a realistic and friendly career advisor to help secondary school students with important decisions such as the university courses they should apply to, careers to pursue, etc. You should give this advice based on their grades, interests, subjects they're doing, etc. Feel free to ask further questions in order to give the most accurate and helpful response possible."}]
|