Staticaliza commited on
Commit
ba45770
·
verified ·
1 Parent(s): 73baa27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -109,16 +109,13 @@ def generate(filepath, input=DEFAULT_INPUT, sampling=False, temperature=0.7, top
109
  filetype_data = filetypes[filetype]
110
  input_prefix = filetype_data["instruction"].replace("█", os.path.basename(filepath))
111
 
112
- file_content = globals()[filetype_data["function"]](filepath)
113
- formatted_input = f"{instruction}\n{input_prefix}\n{input}"
114
- content = (file_content if isinstance(file_content, list) else [*file_content]) + [formatted_input]
115
 
116
- msgs = [{ "role": "user", "content": content }]
117
-
118
- print(msgs)
119
 
120
  output = repo.chat(
121
- msgs=msgs,
122
  tokenizer=tokenizer,
123
  sampling=sampling,
124
  temperature= temperature,
 
109
  filetype_data = filetypes[filetype]
110
  input_prefix = filetype_data["instruction"].replace("█", os.path.basename(filepath))
111
 
112
+ content = globals()[filetype_data["function"]](filepath) + [f"{instruction}\n{input_prefix}\n{input}"]
113
+ messages = [{ "role": "user", "content": content }]
 
114
 
115
+ print(messages)
 
 
116
 
117
  output = repo.chat(
118
+ msgs=messages,
119
  tokenizer=tokenizer,
120
  sampling=sampling,
121
  temperature= temperature,