louisbrulenaudet commited on
Commit
3f19717
1 Parent(s): e04bd7d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -48,29 +48,29 @@ def setup(
48
 
49
  return None, None, description
50
 
51
- try:
52
- model = AutoModelForCausalLM.from_pretrained(
53
- model_id,
54
- torch_dtype=torch.bfloat16,
55
- device_map="auto"
56
- )
57
 
58
- tokenizer = AutoTokenizer.from_pretrained(
59
- model_id
60
- )
 
 
61
 
62
- tokenizer.use_default_system_prompt = False
63
-
64
- # Update the description
65
- description += "\n<p>Model and tokenizer set up successfully.</p>"
66
-
67
- return model, tokenizer, description
 
 
68
 
69
- except Exception as e:
70
- # If an error occurs during setup, append the error message to the description
71
- description += f"\n<p>Error occurred during model setup: {str(e)}</p>"
 
 
72
 
73
- return None, None, description
74
 
75
  DESCRIPTION = """\
76
  # Pearl-7B-0211-ties, an xtraordinary 7B model
 
48
 
49
  return None, None, description
50
 
 
 
 
 
 
 
51
 
52
+ model = AutoModelForCausalLM.from_pretrained(
53
+ model_id,
54
+ torch_dtype=torch.bfloat16,
55
+ device_map="auto"
56
+ )
57
 
58
+ tokenizer = AutoTokenizer.from_pretrained(
59
+ model_id
60
+ )
61
+
62
+ tokenizer.use_default_system_prompt = False
63
+
64
+ # Update the description
65
+ description += "\n<p>Model and tokenizer set up successfully.</p>"
66
 
67
+ return model, tokenizer, description
68
+
69
+ # except Exception as e:
70
+ # # If an error occurs during setup, append the error message to the description
71
+ # description += f"\n<p>Error occurred during model setup: {str(e)}</p>"
72
 
73
+ # return None, None, description
74
 
75
  DESCRIPTION = """\
76
  # Pearl-7B-0211-ties, an xtraordinary 7B model