davidberenstein1957 HF staff commited on
Commit
c0fa328
1 Parent(s): 4d34630

fix: set context window to 1024*128

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -25,12 +25,12 @@ if not os.path.exists(file_path):
25
  ):
26
  f.write(chunk)
27
 
28
-
29
  llm = LlamaCppLLM(
30
  model_path=file_path,
31
  n_gpu_layers=-1,
32
- # n_ctx=1024 * 128,
33
- generation_kwargs={"max_new_tokens": 1024 * 128},
34
  )
35
  task = ArgillaLabeller(llm=llm)
36
  task.load()
@@ -79,6 +79,7 @@ def process_records_gradio(records, example_records, fields, question):
79
 
80
  return json.dumps({"results": results}, indent=2)
81
  except Exception as e:
 
82
  return f"Error: {str(e)}"
83
 
84
 
 
25
  ):
26
  f.write(chunk)
27
 
28
+ context_window = 1024 * 128
29
  llm = LlamaCppLLM(
30
  model_path=file_path,
31
  n_gpu_layers=-1,
32
+ n_ctx=context_window,
33
+ generation_kwargs={"max_new_tokens": context_window},
34
  )
35
  task = ArgillaLabeller(llm=llm)
36
  task.load()
 
79
 
80
  return json.dumps({"results": results}, indent=2)
81
  except Exception as e:
82
+ raise Exception(f"Error: {str(e)}")
83
  return f"Error: {str(e)}"
84
 
85