SamirDze commited on
Commit
cf1491c
·
verified ·
1 Parent(s): 3fc013c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +43 -14
README.md CHANGED
@@ -1,14 +1,43 @@
1
- ---
2
- title: Alg
3
- emoji: 📊
4
- colorFrom: indigo
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 6.2.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- short_description: for embeding image free
12
- ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLIP Image Embedding API
2
+
3
+ Free CLIP embeddings - two deployment options.
4
+
5
+ ## Option 1: Hugging Face Spaces (Recommended - has working API!)
6
+
7
+ 1. Create a new Space at https://huggingface.co/spaces
8
+ 2. Choose "Gradio" as SDK
9
+ 3. Upload `gradio_app.py` as `app.py`
10
+ 4. Upload `requirements.txt`
11
+ 5. Your API will be at: `https://your-username-your-space.hf.space/api/predict`
12
+
13
+ ### API Usage (Gradio)
14
+ ```javascript
15
+ // From Node.js backend
16
+ const response = await axios.post('https://your-space.hf.space/api/predict', {
17
+ data: ['https://example.com/image.jpg']
18
+ });
19
+ const embedding = response.data.data[0].embedding; // 512 dimensions
20
+ ```
21
+
22
+ ### Environment Variable
23
+ ```
24
+ HF_CLIP_URL=https://your-username-your-space.hf.space
25
+ ```
26
+
27
+ ## Option 2: Streamlit Cloud (Web UI only - no API)
28
+
29
+ 1. Push this folder to GitHub
30
+ 2. Go to https://share.streamlit.io
31
+ 3. Deploy `app.py`
32
+
33
+ Note: Streamlit doesn't work as REST API, only for interactive web UI.
34
+
35
+ ## Local Testing
36
+ ```bash
37
+ # Gradio (recommended)
38
+ pip install -r requirements.txt
39
+ python gradio_app.py
40
+
41
+ # Streamlit
42
+ streamlit run app.py
43
+ ```