Tonic commited on
Commit
8dbf509
1 Parent(s): c26c8c2

add cuda stuff

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -1,6 +1,4 @@
1
- import gradio as gr
2
- from huggingface_hub import InferenceClient
3
-
4
  import spaces
5
  import torch
6
  import torch.nn.functional as F
@@ -12,11 +10,17 @@ import queue
12
  import os
13
  import json
14
  import numpy as np
15
-
 
16
  import openai
17
  from openai import OpenAI
18
  from globalvars import API_BASE, API_KEY, intention_prompt
19
 
 
 
 
 
 
20
  ## add chroma vector store
21
 
22
 
 
1
+ # main.py
 
 
2
  import spaces
3
  import torch
4
  import torch.nn.functional as F
 
10
  import os
11
  import json
12
  import numpy as np
13
+ import gradio as gr
14
+ from huggingface_hub import InferenceClient
15
  import openai
16
  from openai import OpenAI
17
  from globalvars import API_BASE, API_KEY, intention_prompt
18
 
19
+ os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:30'
20
+ os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
21
+ os.environ['CUDA_CACHE_DISABLE'] = '1'
22
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
+
24
  ## add chroma vector store
25
 
26