broadfield-dev commited on
Commit
22e9f7d
·
verified ·
1 Parent(s): 8eea1fa

Create run_ollama,py

Browse files
Files changed (1) hide show
  1. run_ollama,py +16 -0
run_ollama,py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ollama
2
+ from huggingface_hub import login
3
+
4
+ def run_ollama(prompt,token=""):
5
+ # Login to Hugging Face
6
+ login(token=token)
7
+
8
+ # Load and run the model
9
+ model = ollama.load_model("tiny_llama")
10
+ response = model.run("Why is the sky blue")
11
+ print(response)
12
+ return response
13
+
14
+ if __name__ == "__main__":
15
+ response = run_ollama()
16
+ print(response)