Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
113 |
-
|
114 |
-
content = (file_content if isinstance(file_content, list) else [*file_content]) + [formatted_input]
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
print(msgs)
|
119 |
|
120 |
output = repo.chat(
|
121 |
-
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,
|