grahamwhiteuk commited on
Commit
a7575a1
·
1 Parent(s): 3ba38dc

fix: double demo doesn't work on CPU message in description field

Browse files
Files changed (1) hide show
  1. src/app.py +2 -2
src/app.py CHANGED
@@ -21,7 +21,7 @@ TITLE = "IBM Granite 3.1 8b Instruct"
21
  DESCRIPTION = """
22
  <p>Granite 3.1 is a general purpose large language model released in the open under an Apache 2.0 license. Granite
23
  models support a 128k context length. Try one of the sample prompts below or write your own. Remember, AI models can
24
- make mistakes. Note: This demo does not work on CPU.
25
  <span class="gr_docs_link">
26
  <a href="https://www.ibm.com/granite/docs/">View Documentation <i class="fa fa-external-link"></i></a>
27
  </span>
@@ -35,7 +35,7 @@ TOP_K = 50
35
  REPETITION_PENALTY = 1.05
36
 
37
  if not torch.cuda.is_available():
38
- DESCRIPTION += "\nThis demo does not work on CPU."
39
 
40
  model = AutoModelForCausalLM.from_pretrained(
41
  "ibm-granite/granite-3.1-8b-instruct", torch_dtype=torch.float16, device_map="auto"
 
21
  DESCRIPTION = """
22
  <p>Granite 3.1 is a general purpose large language model released in the open under an Apache 2.0 license. Granite
23
  models support a 128k context length. Try one of the sample prompts below or write your own. Remember, AI models can
24
+ make mistakes.
25
  <span class="gr_docs_link">
26
  <a href="https://www.ibm.com/granite/docs/">View Documentation <i class="fa fa-external-link"></i></a>
27
  </span>
 
35
  REPETITION_PENALTY = 1.05
36
 
37
  if not torch.cuda.is_available():
38
+ print("This demo may not work on CPU.")
39
 
40
  model = AutoModelForCausalLM.from_pretrained(
41
  "ibm-granite/granite-3.1-8b-instruct", torch_dtype=torch.float16, device_map="auto"