learningai commited on
Commit
f0d1094
·
1 Parent(s): dcd078f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -1,16 +1,19 @@
1
 
 
 
2
 
3
- import torch
4
- from huggingface_hub import login
5
 
6
- login(token="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")
 
 
7
 
8
- # Use a pipeline as a high-level helper
9
- from transformers import pipeline
 
10
 
11
- pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
 
 
12
 
13
- print("Providing input to the pipeline.....")
14
 
15
- response = pipe("Hello, how are you?")
16
- print(response)
 
1
 
2
+ import os
3
+ import gradio
4
 
5
+ os.system("gdown 1L0HmkMQ54le2Eel1r3aJVoxsOLFpTodL")
 
6
 
7
+ from langchain.llms.llamacpp import LlamaCpp
8
+ model_path = "ggml-model-q4_0.bin"
9
+ llm = LlamaCpp(model_path=model_path)
10
 
11
+ def respond(input_text):
12
+ response = llm(input_text)
13
+ return str(response)
14
 
15
+ demo = gradio.Interface(fn=respond, inputs='text', outputs='text')
16
+
17
+ demo.launch()
18
 
 
19