Spaces:
Sleeping
Sleeping
delete file
Browse files- app copy.py +0 -43
app copy.py
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import spaces
|
3 |
-
|
4 |
-
import os
|
5 |
-
import gc
|
6 |
-
import random
|
7 |
-
import warnings
|
8 |
-
|
9 |
-
warnings.filterwarnings("ignore")
|
10 |
-
|
11 |
-
import numpy as np
|
12 |
-
import pandas as pd
|
13 |
-
|
14 |
-
pd.set_option("display.max_rows", 500)
|
15 |
-
pd.set_option("display.max_columns", 500)
|
16 |
-
pd.set_option("display.width", 1000)
|
17 |
-
from tqdm.auto import tqdm
|
18 |
-
|
19 |
-
import torch
|
20 |
-
import torch.nn as nn
|
21 |
-
import tokenizers
|
22 |
-
import transformers
|
23 |
-
|
24 |
-
print(f"tokenizers.__version__: {tokenizers.__version__}")
|
25 |
-
print(f"transformers.__version__: {transformers.__version__}")
|
26 |
-
print(f"torch.__version__: {torch.__version__}")
|
27 |
-
print(f"torch cuda version: {torch.version.cuda}")
|
28 |
-
from transformers import AutoTokenizer, AutoConfig
|
29 |
-
from transformers import BitsAndBytesConfig, AutoModelForCausalLM, MistralForCausalLM
|
30 |
-
from peft import LoraConfig, get_peft_model
|
31 |
-
|
32 |
-
|
33 |
-
title = "H2O AI Predict the LLM"
|
34 |
-
|
35 |
-
zero = torch.Tensor([0]).cuda()
|
36 |
-
print(zero.device) # <-- 'cpu' 🤔
|
37 |
-
|
38 |
-
@spaces.GPU
|
39 |
-
def greet(n):
|
40 |
-
print(zero.device) # <-- 'cuda:0' 🤗
|
41 |
-
return f"Hello {zero + n} Tensor"
|
42 |
-
|
43 |
-
gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text()).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|