MCPcopy Create free account
hub / github.com/M4THYOU/TokenDagger / main

Function main

src/mistral_main.cpp:182–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182int 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
199Consider the following factors in your detailed estimate:
2001. The total number of buildings and windows in Paris (both residential and commercial)
2012. Different types of buildings (apartments, offices, shops, historical buildings, etc.)
2023. The varying heights and accessibility of buildings
2034. Labor costs for professional window cleaners in Paris
2045. Equipment and safety requirements for high-rise buildings
2056. Seasonal variations and weather considerations
2067. Time estimates for completion
2078. Any special considerations for historical or landmark buildings
208
209Please 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;

Callers

nothing calls this directly

Calls 2

LoadTokenizerFunction · 0.70
TokenizeFunction · 0.70

Tested by

no test coverage detected