Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,6 @@ from clarifai_grpc.grpc.api.status import status_code_pb2
|
|
5 |
import torch
|
6 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
7 |
|
8 |
-
#torch.set_default_device("cpu")
|
9 |
-
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True).to(device)
|
10 |
-
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
|
11 |
|
12 |
# GPT-4 credentials
|
13 |
PAT_GPT4 = "3ca5bd8b0f2244eb8d0e4b2838fc3cf1"
|
@@ -38,6 +35,13 @@ MODEL_ID_NEWSGUARDIAN = "your_model_id"
|
|
38 |
MODEL_VERSION_ID_NEWSGUARDIAN = "your_model_version_id"
|
39 |
|
40 |
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
# Set up gRPC channel for NewsGuardian model
|
43 |
channel_tts = ClarifaiChannel.get_grpc_channel()
|
@@ -225,4 +229,9 @@ st.markdown("""
|
|
225 |
<img src="https://user-images.githubusercontent.com/34125851/226601355-ffe0b597-9840-4e10-bbef-43d6c74b5a9e.png" width="2%" alt="" /></a>
|
226 |
</div>
|
227 |
<hr>
|
228 |
-
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
5 |
import torch
|
6 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
7 |
|
|
|
|
|
|
|
8 |
|
9 |
# GPT-4 credentials
|
10 |
PAT_GPT4 = "3ca5bd8b0f2244eb8d0e4b2838fc3cf1"
|
|
|
35 |
MODEL_VERSION_ID_NEWSGUARDIAN = "your_model_version_id"
|
36 |
|
37 |
#
|
38 |
+
import streamlit as st
|
39 |
+
from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
|
40 |
+
from clarifai_grpc.grpc.api import resources_pb2, service_pb2, service_pb2_grpc
|
41 |
+
from clarifai_grpc.grpc.api.status import status_code_pb2
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
|
46 |
# Set up gRPC channel for NewsGuardian model
|
47 |
channel_tts = ClarifaiChannel.get_grpc_channel()
|
|
|
229 |
<img src="https://user-images.githubusercontent.com/34125851/226601355-ffe0b597-9840-4e10-bbef-43d6c74b5a9e.png" width="2%" alt="" /></a>
|
230 |
</div>
|
231 |
<hr>
|
232 |
+
""", unsafe_allow_html=True)
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
|