mingbaer commited on
Commit
ab82d83
·
verified ·
1 Parent(s): 432af8d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FRONTEND: Python library that makes it super easy to build simple user interfaces (UIs)
2
+ import gradio as gr
3
+ # BACKEND: tool from Hugging Face library to send messages to AI models and get answers back
4
+ from huggingface_hub import InferenceClient
5
+ # Helpful commentary from ChatGPT:
6
+ # Gradio is the face and mouth — it lets people talk to the robot.
7
+ # InferenceClient is the brain connector — it lets your robot talk to a super-smart brain (the Hugging Face model) and get answers.
8
+ from sentence_transformers import SentenceTransformer
9
+ # a Python library that allows you to turn sentences into numerical vector embeddings
10
+ import torch
11
+ # a machine learning library that that performs cosine similarity calculations
12
+ import numpy as np
13
+