PeterPinetree commited on
Commit
020a95f
ยท
1 Parent(s): 6eb3128

Add Hugging Face metadata to README with indigo-purple theme

Browse files
Files changed (1) hide show
  1. README.md +119 -22
README.md CHANGED
@@ -1,4 +1,28 @@
1
- # Next-Token Predictor# Next-Token Predictor# Next-Token Predictor---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
 
4
 
@@ -6,23 +30,23 @@ A clean, modern web app that demonstrates how AI language models predict the nex
6
 
7
 
8
 
9
- ![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)A clean, modern web app that demonstrates how AI language models predict the next word in a sequence. Built with Gradio for easy deployment and secure token management.title:# Next-Token Predictor
10
 
11
 
12
 
13
- ## โœจ Features
14
 
15
 
16
 
17
- - **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)A clean, modern web app that demonstrates how AI language models predict the next word in a sequence. Built with Gradio for easy deployment and secure token management.
18
 
19
  - **๐Ÿ”’ Secure**: Uses environment variables for API tokens
20
 
21
- - **โšก Fast**: Serverless API calls with instant results
22
 
23
  - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interface
24
 
25
- - **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces## โœจ Features๐ŸŽฏ **Note**: This project has been converted to a Gradio app! See `README-gradio.md` for the latest version.
26
 
27
 
28
 
@@ -30,72 +54,145 @@ A clean, modern web app that demonstrates how AI language models predict the nex
30
 
31
 
32
 
33
- 1. **Install dependencies:**- **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)
34
 
35
  ```bash
36
 
37
- pip install -r requirements.txt- **๐Ÿ”’ Secure**: Uses environment variables for API tokens
38
 
39
  ```
40
 
41
- - **โšก Fast**: Serverless API calls with instant resultsA web application that demonstrates how AI language models predict the next word in a sequence. Originally built with HTML/JavaScript, now available as a streamlined Gradio app for easier deployment and better security.
42
 
43
  2. **Set your HF token:**
44
 
45
- - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interface
46
 
47
  **Option A: Using .env file (Recommended for local development)**
48
 
49
- ```bash- **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces## โœจ Features
50
 
51
  # Copy the template
52
 
53
- cp .env.example .env
54
 
55
 
56
 
57
- # Edit .env and add your token:## ๐Ÿš€ Quick Start## ๐Ÿš€ Quick Start
58
 
59
  # HF_NEXT_TOKEN_PREDICTOR_TOKEN=hf_your_actual_token_here
60
 
61
- ```
62
 
63
 
64
 
65
- **Option B: Using environment variable**1. **Install dependencies:**- **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type
66
 
67
  ```bash
68
 
69
- export HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Linux/Mac ```bash
70
 
71
  $env:HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Windows PowerShell
72
 
73
- ``` pip install -r requirements.txt- **๐Ÿ”’ Secure**: Uses environment variables for API tokens **For the latest Gradio version**, see `README-gradio.md` and run:
74
 
75
 
76
 
77
- 3. **Run the app:** ```
78
 
79
  ```bash
80
 
81
- python app.py- **โšก Fast**: Serverless API calls with instant results```bash
82
 
83
  ```
84
 
85
- 2. **Set your HF token:**
86
 
87
  4. **Open browser:** Navigate to `http://127.0.0.1:7860`
88
 
89
- - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interfacepython app.py
90
 
91
  ## ๐Ÿ”ง Deploy to HF Spaces
92
 
93
- **Option A: Using .env file (Recommended for local development)**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  1. Create a new **Gradio Space** on Hugging Face
96
 
 
 
97
  2. Upload `app.py` and `requirements.txt` ```bash- **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces```
98
 
 
99
  3. Set `HF_NEXT_TOKEN_PREDICTOR_TOKEN` as a **repository secret** (not as .env file)
100
 
101
  4. Your demo is live! โœจ # Copy the template
 
1
+ ---# Next-Token Predictor# Next-Token Predictor# Next-Token Predictor---
2
+
3
+ title: Next-Token Predictor
4
+
5
+ emoji: ๐Ÿ”ฎ
6
+
7
+ colorFrom: indigo
8
+
9
+ colorTo: purpleA clean, modern web app that demonstrates how AI language models predict the next word in a sequence. Built with Gradio for easy deployment and secure token management.
10
+
11
+ sdk: gradio
12
+
13
+ sdk_version: 4.44.0
14
+
15
+ app_file: app.py
16
+
17
+ pinned: false![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)A clean, modern web app that demonstrates how AI language models predict the next word in a sequence. Built with Gradio for easy deployment and secure token management.title:# Next-Token Predictor
18
+
19
+ short_description: Demonstrate how AI language models predict the next word in a sequence
20
+
21
+ ---
22
+
23
+
24
+
25
+ # Next-Token Predictor## โœจ Features
26
 
27
 
28
 
 
30
 
31
 
32
 
33
+ ![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)- **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)A clean, modern web app that demonstrates how AI language models predict the next word in a sequence. Built with Gradio for easy deployment and secure token management.
34
 
35
 
36
 
37
+ ## โœจ Features- **๐Ÿ”’ Secure**: Uses environment variables for API tokens
38
 
39
 
40
 
41
+ - **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type- **โšก Fast**: Serverless API calls with instant results
42
 
43
  - **๐Ÿ”’ Secure**: Uses environment variables for API tokens
44
 
45
+ - **โšก Fast**: Serverless API calls with instant results- **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interface
46
 
47
  - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interface
48
 
49
+ - **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces- **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces## โœจ Features๐ŸŽฏ **Note**: This project has been converted to a Gradio app! See `README-gradio.md` for the latest version.
50
 
51
 
52
 
 
54
 
55
 
56
 
57
+ 1. **Install dependencies:**## ๐Ÿš€ Quick Start
58
 
59
  ```bash
60
 
61
+ pip install -r requirements.txt
62
 
63
  ```
64
 
65
+ 1. **Install dependencies:**- **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type![Demo](https://img.shields.io/badge/Demo-Live-brightgreen) ![Python](https://img.shields.io/badge/Python-3.8+-blue) ![Gradio](https://img.shields.io/badge/Gradio-4.44+-orange)
66
 
67
  2. **Set your HF token:**
68
 
69
+ ```bash
70
 
71
  **Option A: Using .env file (Recommended for local development)**
72
 
73
+ ```bash pip install -r requirements.txt- **๐Ÿ”’ Secure**: Uses environment variables for API tokens
74
 
75
  # Copy the template
76
 
77
+ cp .env.example .env ```
78
 
79
 
80
 
81
+ # Edit .env and add your token:- **โšก Fast**: Serverless API calls with instant resultsA web application that demonstrates how AI language models predict the next word in a sequence. Originally built with HTML/JavaScript, now available as a streamlined Gradio app for easier deployment and better security.
82
 
83
  # HF_NEXT_TOKEN_PREDICTOR_TOKEN=hf_your_actual_token_here
84
 
85
+ ```2. **Set your HF token:**
86
 
87
 
88
 
89
+ **Option B: Using environment variable** - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interface
90
 
91
  ```bash
92
 
93
+ export HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Linux/Mac **Option A: Using .env file (Recommended for local development)**
94
 
95
  $env:HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Windows PowerShell
96
 
97
+ ``` ```bash- **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces## โœจ Features
98
 
99
 
100
 
101
+ 3. **Run the app:** # Copy the template
102
 
103
  ```bash
104
 
105
+ python app.py cp .env.example .env
106
 
107
  ```
108
 
109
+
110
 
111
  4. **Open browser:** Navigate to `http://127.0.0.1:7860`
112
 
113
+ # Edit .env and add your token:## ๐Ÿš€ Quick Start## ๐Ÿš€ Quick Start
114
 
115
  ## ๐Ÿ”ง Deploy to HF Spaces
116
 
117
+ # HF_NEXT_TOKEN_PREDICTOR_TOKEN=hf_your_actual_token_here
118
+
119
+ 1. Create a new **Gradio Space** on Hugging Face
120
+
121
+ 2. Upload `app.py` and `requirements.txt` ```
122
+
123
+ 3. Set `HF_NEXT_TOKEN_PREDICTOR_TOKEN` as a **repository secret** (not as .env file)
124
+
125
+ 4. Your demo is live! โœจ
126
+
127
+
128
+
129
+ ## ๐Ÿ’ฐ Cost **Option B: Using environment variable**1. **Install dependencies:**- **๐Ÿ”ฎ Real-time Predictions**: Updates automatically as you type
130
+
131
+
132
+
133
+ With HF Pro account ($20/month): ```bash
134
+
135
+ - **$2.00/month** in free API calls
136
+
137
+ - **~$0.0001** per prediction export HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Linux/Mac ```bash
138
+
139
+ - **2,000-20,000** free predictions/month
140
+
141
+ $env:HF_NEXT_TOKEN_PREDICTOR_TOKEN="hf_your_token_here" # Windows PowerShell
142
+
143
+ ## ๐ŸŽฏ Try It
144
+
145
+ ``` pip install -r requirements.txt- **๐Ÿ”’ Secure**: Uses environment variables for API tokens **For the latest Gradio version**, see `README-gradio.md` and run:
146
+
147
+ Type "Twinkle, twinkle, little " and watch the AI predict "star"!
148
+
149
+
150
+
151
+ The app demonstrates how language models work by showing real-time probability distributions for the next token in any sequence.
152
+
153
+ 3. **Run the app:** ```
154
+
155
+ ## ๐Ÿ”’ Security Notes
156
+
157
+ ```bash
158
+
159
+ - **โœ… .env file**: Safe for local development (ignored by git)
160
+
161
+ - **โœ… Environment variables**: Work everywhere python app.py- **โšก Fast**: Serverless API calls with instant results```bash
162
+
163
+ - **โœ… HF Spaces secrets**: Secure for production deployment
164
+
165
+ - **โŒ Never commit**: Your actual token to version control ```
166
+
167
+
168
+
169
+ ## ๐Ÿ“ Project Structure2. **Set your HF token:**
170
+
171
+
172
+
173
+ ```4. **Open browser:** Navigate to `http://127.0.0.1:7860`
174
+
175
+ โ”œโ”€โ”€ app.py # Main Gradio application
176
+
177
+ โ”œโ”€โ”€ requirements.txt # Python dependencies - **๐Ÿ“ฑ Responsive**: Clean, mobile-friendly interfacepython app.py
178
+
179
+ โ”œโ”€โ”€ .env.example # Template for environment variables
180
+
181
+ โ”œโ”€โ”€ .env # Your actual tokens (git ignored)## ๐Ÿ”ง Deploy to HF Spaces
182
+
183
+ โ”œโ”€โ”€ .gitignore # Protects secrets from being committed
184
+
185
+ โ””โ”€โ”€ README.md # This file **Option A: Using .env file (Recommended for local development)**
186
+
187
+ ```
188
 
189
  1. Create a new **Gradio Space** on Hugging Face
190
 
191
+ ## ๐Ÿค Contributing
192
+
193
  2. Upload `app.py` and `requirements.txt` ```bash- **๐Ÿš€ Easy Deploy**: One-click deployment to HF Spaces```
194
 
195
+ Feel free to improve the API parsing, add features, or enhance the design!
196
  3. Set `HF_NEXT_TOKEN_PREDICTOR_TOKEN` as a **repository secret** (not as .env file)
197
 
198
  4. Your demo is live! โœจ # Copy the template