-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert ":sparkles: Add PdfLoader (#74)"
This reverts commit 36b593a.
- Loading branch information
Showing
11 changed files
with
181 additions
and
312 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export default ` | ||
The Meaty Code of Sir Loin | ||
In the bustling town of Byteville, there was a developer unlike any other. | ||
Sir Loin, as he was fondly called, had a peculiar method of coding. | ||
While others used keyboards and mice, Sir Loin used meats. Yes, you read that right. Meats! | ||
Sir Loin believed that every piece of meat had a unique texture and essence that could be translated into code. | ||
He had a special butcher's table instead of a regular desk. | ||
On it, instead of the usual computer setup, there were slabs of meat of various kinds: | ||
beef, chicken, pork, and even some exotic ones like kangaroo and ostrich. | ||
Each meat type represented a different programming language. Beef was for Java, given its robustness. | ||
Chicken, being versatile, was for Python. Pork, with its layers, was for HTML/CSS, and the exotic meats were for the lesser-known languages. | ||
Sir Loin's coding process was a sight to behold. To start a new project, he'd tenderize a piece of meat, marinating it with special herbs representing libraries and frameworks. For debugging, he'd sniff the meat. Freshness indicated bug-free code, while any off-odors meant there were errors. | ||
His IDE? A massive grill. To compile the code, he'd cook the meat. | ||
The cooking time varied depending on the complexity of the project. | ||
Once done, he'd feed the meat to his pet, Byte, a mini pig with a keen sense for code quality. | ||
If Byte ate the meat without hesitation, the code was perfect. | ||
If Byte hesitated or refused, it was back to the butcher's table for Sir Loin. | ||
People from all over came to witness this bizarre coding method. | ||
Many were skeptical, but when they saw the efficiency and tasted the delicious results, they were believers. | ||
Sir Loin's applications were not only functional but also had this unique 'flavor' to them, making them popular across Byteville. | ||
One day, a challenge arose. | ||
The town's main server, which held crucial data, crashed. | ||
The best developers tried to revive it but to no avail. | ||
The mayor, in desperation, turned to Sir Loin. With a massive slab of wagyu beef (reserved for the most complex of codes), Sir Loin got to work. | ||
He marinated, grilled, debugged, and re-grilled for hours. | ||
Byte, after tasting the wagyu, gave a satisfied oink. | ||
And just like that, the server whirred back to life. | ||
Sir Loin's meaty method became legendary. | ||
He started a school, "The Butcher's Code", teaching others the art of meat coding. | ||
It was a rigorous program, combining culinary skills with coding, but it produced some of the finest developers Byteville had ever seen. | ||
Years later, people would speak of the legend of Sir Loin, the meat-coding maestro. | ||
They'd talk about how he changed the face of development in Byteville, all while serving up some of the most delicious barbecues the town had ever tasted. | ||
And so, in the heart of Byteville, amidst all the tech and modern coding methods, there remained a place where meats and codes blended in a symphony, all thanks to the genius of Sir Loin. | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
ID,Name,Email,Age,City,Product | ||
1,John Doe,[email protected],34,New York,TV | ||
2,Jane Smith,[email protected],28,Los Angeles,Laptop | ||
3,Robert Brown,[email protected],45,Chicago,Refrigerator | ||
4,Emily Davis,[email protected],22,Houston,Smartphone | ||
5,Chris Wilson,[email protected],31,Phoenix,Tablet | ||
6,Lucy Johnson,[email protected],40,Philadelphia,Watch | ||
7,Michael White,[email protected],50,San Antonio,Microwave | ||
8,Emma Jones,[email protected],29,San Diego,Camera | ||
9,Brian Anderson,[email protected],37,Dallas,Headphones | ||
10,Sophia Martinez,[email protected],25,San Jose,Bicycle | ||
11,James Taylor,[email protected],32,Austin,Bookshelf | ||
12,Nicole Lee,[email protected],27,Jacksonville,Blender | ||
13,William Harris,[email protected],44,San Francisco,Oven | ||
14,Lily Clark,[email protected],24,Indianapolis,Coffee Maker | ||
15,Kevin Lewis,[email protected],42,Columbus,Vacuum Cleaner | ||
16,Olivia Young,[email protected],35,Charlotte,Radio | ||
17,Richard Hall,[email protected],49,Seattle,Printer | ||
18,Grace Allen,[email protected],23,Denver,Washing Machine | ||
19,Joseph Turner,[email protected],52,Boston,Smartphone | ||
20,Anna Walker,[email protected],26,El Paso,Toaster | ||
21,David King,[email protected],38,Nashville,Recliner | ||
22,Mia Wright,[email protected],30,Portland,Dishwasher | ||
23,Charles Rodriguez,[email protected],41,Memphis,Rice Cooker | ||
24,Chloe Green,[email protected],33,Las Vegas,Gaming Console | ||
25,Stephen Parker,[email protected],47,Louisville,Fan | ||
26,Zoe Thompson,[email protected],21,Milwaukee,Grill | ||
27,Benjamin Adams,[email protected],39,Albuquerque,Air Purifier | ||
28,Ella Nelson,[email protected],36,Tucson,Router | ||
29,Andrew Mitchell,[email protected],53,Fresno,Smart Watch | ||
30,Madison Scott,[email protected],20,Sacramento,Smartphone | ||
31,Daniel Rivera,[email protected],55,Kansas City,Smartphone | ||
32,Isabella Morris,[email protected],42,Long Beach,Juicer | ||
33,Raymond Carter,[email protected],48,Mesa,Sunglasses | ||
34,Abigail Price,[email protected],43,Atlanta,Notebook | ||
35,Edward Perez,[email protected],46,Omaha,Kettle | ||
36,Victoria Hughes,[email protected],29,Cleveland,DVD Player | ||
37,Anthony Collins,[email protected],40,Minneapolis,Smartphone | ||
38,Jessica Rogers,[email protected],51,Tampa,Hat | ||
39,Mark Flores,[email protected],37,Orlando,Watch | ||
40,Laura Torres,[email protected],45,New Orleans,Backpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { generate } from "../../lib/index"; | ||
import { AudioLoader, StringLoader, TextFileLoader } from "../../lib/dataloader"; | ||
import { generate } from "../../lib/generate"; | ||
import weirdStory from "./StringLoader"; | ||
import fs from "fs"; | ||
|
||
const clientOptions = { | ||
endpoint: "https://api.polyfact.com", | ||
token: "<YOUR_POLYFACT_TOKEN>", // You can get one at https://app.polyfact.com/ | ||
}; | ||
(async () => { | ||
// Generate and ask question from an audio file | ||
fs.readFile(`${__dirname}/AudioLoader.mp3`, async (_err, data) => { | ||
const response = await generate( | ||
"The man ask a question. Find and Answer at this one.", | ||
{ | ||
data: AudioLoader(data), | ||
model: "gpt-4", | ||
}, | ||
clientOptions, | ||
); | ||
console.log(response); | ||
}); | ||
|
||
// Generate and ask question from a text file with token usage | ||
|
||
fs.readFile(`${__dirname}/TextFileLoader.csv`, async (_err, data) => { | ||
const res2 = await generate( | ||
"Give me back the only rows for people who bought a Smartphone (Product column)\n", | ||
{ | ||
data: TextFileLoader(data), | ||
model: "gpt-4", | ||
infos: true, | ||
}, | ||
clientOptions, | ||
); | ||
|
||
console.log(res2); | ||
}); | ||
|
||
// Generate and ask question from a big string with token usage | ||
const res3 = await generate( | ||
"What are strange or unreal in this story ?", | ||
{ | ||
data: StringLoader(weirdStory), | ||
model: "gpt-4", | ||
infos: true, | ||
}, | ||
clientOptions, | ||
); | ||
|
||
console.log(res3); | ||
|
||
// Generate a stream and ask question from an audio file | ||
fs.readFile(`${__dirname}/AudioLoader.mp3`, async (_err, data) => { | ||
const stream = generate( | ||
"What does this audio talk about? ", | ||
{ | ||
data: AudioLoader(data), | ||
model: "gpt-3.5-turbo-16k", | ||
stream: true, | ||
}, | ||
clientOptions, | ||
); | ||
stream.pipe(process.stdout); | ||
await new Promise((res) => stream.on("end", res)); | ||
process.stdout.write("\n"); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.