Skip to content

Commit

Permalink
Fix python code scan warnings
Browse files Browse the repository at this point in the history
Set CUDA on by default in CMakeLists.txt
  • Loading branch information
RyanUnderhill committed Jan 23, 2024
1 parent d4d02db commit 0e3775d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ check_language(CUDA)
if (CMAKE_CUDA_COMPILER)
set (CUDA_FOUND TRUE)
endif()

set(USE_CUDA 1)

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
message(FATAL_ERROR "GCC version must be greater than or equal to 9")
Expand Down
10 changes: 5 additions & 5 deletions download_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def check_ort_import():
try:
import onnxruntime as ort
except:
except Exception as ex:
return False

return True
Expand All @@ -22,13 +22,13 @@ def get_models(args: argparse.Namespace):
"-m",
"onnxruntime.transformers.models.llama.convert_to_onnx",
"-m",
"meta-llama/Llama-2-7b-hf",
"meta-llama/Llama-2-7b-chat-hf",
"--output",
"llama2-7b-fp32-cpu",
"llama2-7b-chat-int4-gpu",
"--precision",
"fp32",
"int4",
"--execution_provider",
"cpu"
"cuda"
])
# subprocess.run(["mv", "gpt2_parity_results.csv", args.output_folder])

Expand Down
2 changes: 1 addition & 1 deletion download_test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def check_ort_import():
try:
import onnxruntime as ort
except:
except Exception as ex:
return False

return True
Expand Down
1 change: 0 additions & 1 deletion src/pybind/llama_hl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import onnxruntime_genai as og
import numpy as np
import time
from transformers import LlamaTokenizer

Expand Down
1 change: 0 additions & 1 deletion src/pybind/run_llama_opt_ort.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import datetime
import numpy as np
from transformers import LlamaTokenizer
import onnxruntime_genai as og

Expand Down
1 change: 0 additions & 1 deletion src/pybind/test_beam.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import onnxruntime_genai as og
import numpy as np
from transformers import GPT2Tokenizer

device_type = og.DeviceType.CPU
Expand Down
1 change: 0 additions & 1 deletion src/pybind/test_greedy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import onnxruntime_genai as og
import numpy as np
from transformers import GPT2Tokenizer

device_type = og.DeviceType.CPU
Expand Down

0 comments on commit 0e3775d

Please sign in to comment.