jasvir-singh1021 commited on
Commit
5698eae
·
verified ·
1 Parent(s): 7a6b61d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -2,20 +2,14 @@ import gradio as gr
2
  from ctransformers import AutoModelForCausalLM
3
  import time
4
 
5
- # Note: If this is a private or gated repo, you need to authenticate with your HF token.
6
- # You can do this by setting the environment variable HF_HOME or passing token to from_pretrained.
7
- # For public repos, no extra auth needed.
8
-
9
  llm = AutoModelForCausalLM.from_pretrained(
10
- "TheBloke/WizardCoder-Python-7B-V1.0-GGUF", # Updated model name
11
- model_file="wizardcoder-python-7b-v1.0.Q4_K_M.gguf", # Adjust the filename accordingly
12
  model_type="llama",
13
- config={
14
- "max_new_tokens": 512,
15
- "temperature": 0.7,
16
- "top_p": 0.9,
17
- "stream": True
18
- }
19
  )
20
 
21
  def generate_response(message, history):
@@ -32,7 +26,6 @@ def generate_response(message, history):
32
  time.sleep(0.01)
33
  yield history
34
 
35
- # Gradio UI
36
  with gr.Blocks() as demo:
37
  chatbot = gr.Chatbot()
38
  msg = gr.Textbox(placeholder="Ask coding questions...", label="Your Message")
 
2
  from ctransformers import AutoModelForCausalLM
3
  import time
4
 
 
 
 
 
5
  llm = AutoModelForCausalLM.from_pretrained(
6
+ "TheBloke/WizardCoder-Python-7B-V1.0-GGUF",
7
+ model_file="wizardcoder-python-7b-v1.0.Q4_K_M.gguf",
8
  model_type="llama",
9
+ max_new_tokens=512,
10
+ temperature=0.7,
11
+ top_p=0.9,
12
+ stream=True
 
 
13
  )
14
 
15
  def generate_response(message, history):
 
26
  time.sleep(0.01)
27
  yield history
28
 
 
29
  with gr.Blocks() as demo:
30
  chatbot = gr.Chatbot()
31
  msg = gr.Textbox(placeholder="Ask coding questions...", label="Your Message")