| 180 | } |
| 181 | |
| 182 | int main() { |
| 183 | // printf("Hello, World!\n"); |
| 184 | // printf("Safetensors library included successfully!\n"); |
| 185 | |
| 186 | // LoadModel("/home/ubuntu/mistral_models/ministral-8b-2410/consolidated.safetensors"); |
| 187 | |
| 188 | // build the tokenizer. |
| 189 | std::string tokenizer_path = "/home/ubuntu/mistral_models/ministral-8b-2410/tekken.json"; |
| 190 | MistralTokenizer tokenizer; |
| 191 | LoadTokenizer(tokenizer_path, tokenizer); |
| 192 | |
| 193 | // printf("Tokenizer loaded successfully!\n"); |
| 194 | // printf("Tokenizer config: %s\n", tokenizer.config.version.c_str()); |
| 195 | // printf("Tokenizer vocab size: %zu\n", tokenizer.vocab.size()); |
| 196 | |
| 197 | std::string prompt = R"""(You are an expert urban planner and cost estimator with deep knowledge of Paris, France. I need you to provide a comprehensive analysis of what it would cost to hire professional window cleaners to clean all the windows in Paris. |
| 198 | |
| 199 | Consider the following factors in your detailed estimate: |
| 200 | 1. The total number of buildings and windows in Paris (both residential and commercial) |
| 201 | 2. Different types of buildings (apartments, offices, shops, historical buildings, etc.) |
| 202 | 3. The varying heights and accessibility of buildings |
| 203 | 4. Labor costs for professional window cleaners in Paris |
| 204 | 5. Equipment and safety requirements for high-rise buildings |
| 205 | 6. Seasonal variations and weather considerations |
| 206 | 7. Time estimates for completion |
| 207 | 8. Any special considerations for historical or landmark buildings |
| 208 | |
| 209 | Please provide your estimate in US Dollars, breaking down the major cost components. Also include any assumptions you're making and potential challenges that could affect the final cost.)"""; |
| 210 | |
| 211 | Tokenize(tokenizer, prompt); |
| 212 | |
| 213 | std::string lorem_prompt; |
| 214 | std::ifstream lorem_file("./tests/input/lorem.txt"); |
| 215 | if (lorem_file.is_open()) { |
| 216 | std::stringstream buffer; |
| 217 | buffer << lorem_file.rdbuf(); |
| 218 | lorem_prompt = buffer.str(); |
| 219 | lorem_file.close(); |
| 220 | } else { |
| 221 | printf("Error: Could not open ./tests/lorem.txt\n"); |
| 222 | return 1; |
| 223 | } |
| 224 | |
| 225 | |
| 226 | printf("\nLoaded lorem ipsum prompt (%zu characters)\n", lorem_prompt.length()); |
| 227 | Tokenize(tokenizer, lorem_prompt); |
| 228 | |
| 229 | |
| 230 | std::string emoji_prompt; |
| 231 | std::ifstream emoji_file("./tests/input/emoji.txt"); |
| 232 | if (emoji_file.is_open()) { |
| 233 | std::stringstream buffer; |
| 234 | buffer << emoji_file.rdbuf(); |
| 235 | emoji_prompt = buffer.str(); |
| 236 | emoji_file.close(); |
| 237 | } else { |
| 238 | printf("Error: Could not open ./tests/emoji.txt\n"); |
| 239 | return 1; |
nothing calls this directly
no test coverage detected