-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified llama2.c.dll #507
Comments
I have done this to call from PHP for a web app but I haven't shared it on github yet. It's not a big modification, especially since the refactor on this repo. It consists of passing a pointer to the main function with what would be arguments for a CLI, putting the pointer in transformer.data, replacing the fread with memcpy in the read_configuration, and I think that's it. I can upload if there's nothing out there right now. |
https://github.com/jameswdelancey/llama3.c/blob/master/runqdll.c#L1054 If you look at the bottom, you can see how quick and dirty replicated the CLI args with the build_main call. This works with the quantized version of LLaMA 3B base or instruct when exported by export.py as a version-2 (quantized ak42 magic) |
It doesn't work with LLaMA2 or tinyshakespear or tinystories though, because the overhaul to Llama3 has taken place, but can be backported. |
I found dll that can chat with llm-s using one simple function without pointers and structures: https://github.com/tinyBigGAMES/Dllama
Could you add such simple function to your dll, please? |
Llama.dll that can be downloaded from llama.cpp repo is suitable mostly for programming languages that have abilities to work with rather difficult (for novice coder) concepts like pointers, structures etc. The same thing applies to this repo. So the question is: does anybody know any simplified implementation of llama2.c.dll or llama.cpp.dll? For example, it would be wonderful if it will be possible to work with this dll in such way:
CONSOLE
Dim LLama_DLL as Integer
Load "llama.dll" as LLama_DLL
Call function Load_Local_Gguf ("Llama-2-7b-q8.0.gguf") from LLama_DLL
Call function Set_Context_Size_For_Loaded_Gguf (4096) from LLama_DLL
Dim Answer$ As String
Dim Question$ As String
Label #Begin
Input Question$
Answer$ = Call function SentPromptToLoadedGguf (Question$) from LLama_DLL
Print Answer$
Goto #Begin
The text was updated successfully, but these errors were encountered: