acecalisto3 commited on
Commit
e3ee664
·
verified ·
1 Parent(s): 11b4e39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -5,6 +5,12 @@ import os
5
  import requests
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
 
 
 
 
 
 
8
  class InferenceClient:
9
  def __init__(self):
10
  pass
@@ -38,8 +44,8 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
38
 
39
  # Load the pre-trained model and tokenizer
40
  model_name = "mistralai/Mixtral-8x7B-Instruct-v0.1"
41
- model = AutoModelForCodeGeneration.from_pretrained(model_name)
42
- tokenizer = AutoTokenizerForCodeGeneration.from_pretrained(model_name)
43
 
44
  # Define input prompt
45
  input_prompt = "(input value = highest-level-quality code content invocation ; True)"
@@ -55,8 +61,7 @@ generated_code_str = tokenizer.batch_decode(generated_code, skip_special_tokens=
55
 
56
  # Print the generated code
57
  print(generated_code_str)
58
- # Constants for enhanced organization
59
- GITHUB_API_BASE_URL = "https://api.github.com/repos"
60
  DEFAULT_MODEL = "apple/OpenELM"
61
  MAX_RELATED_ISSUES = 3
62
 
 
5
  import requests
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
8
+ # Constants for enhanced organization
9
+ system_message = "You are GitBot, the Github project guardian angel. You resolve issues and propose implementation of feature requests"
10
+ max_tokens = 2048
11
+ temperature = 0.71
12
+ top_p = 0.95
13
+
14
  class InferenceClient:
15
  def __init__(self):
16
  pass
 
44
 
45
  # Load the pre-trained model and tokenizer
46
  model_name = "mistralai/Mixtral-8x7B-Instruct-v0.1"
47
+ model = AutoModelForCausalLM.from_pretrained(model_name)
48
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
49
 
50
  # Define input prompt
51
  input_prompt = "(input value = highest-level-quality code content invocation ; True)"
 
61
 
62
  # Print the generated code
63
  print(generated_code_str)
64
+
 
65
  DEFAULT_MODEL = "apple/OpenELM"
66
  MAX_RELATED_ISSUES = 3
67