CORE Computer Science Conference Rankings

Reading others’ work is important for students and academics. It helps make sure our work is unique and keeps us updated on the latest in our field. But time is limited, so we need to be smart about what we read. If we find a paper that directly relates to our work, it’s essential to read it carefully, cite it, and compare our work to it. Don’t judge a paper by where it’s published; great work can be found anywhere.

Knowing which conferences to focus on can make all the difference in a researcher’s journey. 🌐 In that spirit, I’ve compiled a list of CORE computer science conferences along with their rankings. Check out the rankings here to discover the conferences that are shaping the future of our field. 📚💻

Acronym Standard Name Rank
AAAI National Conference of the American Association for Artificial Intelligence A+
AAMAS International Conference on Autonomous Agents and Multiagent Systems A+
ACL Association of Computational Linguistics A+
ACMMM ACM Multimedia Conference A+
ASPLOS Architectural Support for Programming Languages and Operating Systems A+
CAV Computer Aided Verification A+
CCS ACM Conference on Computer and Communications Security A+
CHI International Conference on Human Factors in Computing Systems A+
COLT Annual Conference on Computational Learning Theory A+
CSCL Computer Supported Collaborative Learning A+
DCC IEEE Data Compression Conference A+
DSN International Conference on Dependable Systems A+
EuroCrypt International Conference on the Theory and Application of Cryptographic Techniques A+
FOCS IEEE Symposium on Foundations of Computer Science A+
FOGA Foundations of Genetic Algorithms A+
HPCA IEEE Symposium on High Performance Computer Architecture A+
I3DG ACM-SIGRAPH Interactive 3D Graphics A+
ICAPS International Conference on Automated Planning and Scheduling A+
ICCV IEEE International Conference on Computer Vision A+
ICDE IEEE International Conference on Data Engineering A+
ICDM IEEE International Conference on Data Mining A+
ICFP International Conference on Functional Programming A+
ICIS International Conference on Information Systems A+
ICML International Conference on Machine Learning A+
ICSE International Conference on Software Engineering A+
IJCAI International Joint Conference on Artificial Intelligence A+
IJCAR International Joint Conference on Automated Reasoning A+
INFOCOM Joint Conference of the IEEE Computer and Communications Societies A+
InfoVis IEEE Information Visualization Conference A+
IPSN Information Processing in Sensor Networks A+
ISCA ACM International Symposium on Computer Architecture A+
ISMAR IEEE and ACM International Symposium on Mixed and Augmented Reality A+
ISSAC International. Symposium on Symbolic and Algebraic Computation A+
ISWC IEEE International Symposium on Wearable Computing A+
IWQoS IFIP International Workshop on QoS A+
JCDL ACM Conference on Digital Libraries A+
KR International Conference on Principles of KR & Reasoning A+
LICS IEEE Symposium on Logic in Computer Science A+
MOBICOM ACM International Conferencem on Mobile Computing and Networking A+
NIPS Advances in Neural Information Processing Systems A+
OOPSLA ACM Conference on Object Oriented Programming Systems Languages and Applications A+
OSDI Usenix Symposium on Operating Systems Design and Implementation A+
PERCOM IEEE International Conference on Pervasive Computing and Communications A+
PERVASIVE International Conference on Pervasive Computing A+
PLDI ACM-SIGPLAN Conference on Programming Language Design & Implementation A+
PODC ACM Symposium on Principles of Distributed Computing A+
PODS ACM SIGMOD-SIGACT-SIGART Conferenceon Principles of Database Systems A+
POPL ACM-SIGACT Symposium on Principles of Prog Langs A+
RSS Robotics: Systems and Science A+
RTSS Real Time Systems Symp A+
SENSYS ACM Conference on Embedded Networked Sensor Systems A+
SIGCOMM ACM Conference on Applications, Technologies,Architectures, and Protocols for Computer Communication A+
SIGGRAPH ACM SIG International Conference on Computer Graphics and Interactive Techniques A+
SIGIR ACM International Conference on Research and Development in Information Retrieval A+
SIGKDD ACM International Conference on Knowledge Discovery and Data Mining A+
SIGMETRICS ACM SIG on computer and communications metrics and performance A+
SIGMOD ACM Special Interest Group on Management of Data Conference A+
SODA ACM/SIAM Symposium on Discrete Algorithms A+
SOSP ACM SIGOPS Symposium on Operating Systems Principles A+
STOC ACM Symposium on Theory of Computing A+
UAI Conference in Uncertainty in Artifical Intelligence A+
UbiComp Uniquitous Computing A+
VLDB International Conference on Very Large Databases A+
WWW International World Wide Web Conference A+
ACM-HT ACM Hypertext Conf A
AH International Conference on Adaptive Hypermedia and Adaptive Web-Based Systems A
AID International Conference on AI in Design A
AIED International Conference on Artificial Intelligence in Education A
AIIM Artificial Intelligence in Medicine A
AiML Advances in Modal Logic A
ALENEX Workshop on Algorithm Engineering and Experiments A
ALIFE International Conference on the Simulation and Synthesis of Living Systems A
AMAI Artificial Intelligence and Maths A
AMIA American Medical Informatics Annual Fall Symposium A
AOSD Aspect-Oriented Software Development A
APPROX International Workshop on Approximation Algorithms for Combinatorial Optimization Problems A
ASAP International Conference on Apps for Specific Array Processors A
ASE Automated Software Engineering Conference A
ASIACRYPT International Conference on the Theory and Applications of Cryptology A
ASIS&T Annual conference of American Society for Information Science and Technology A
ATVA International Symposium on Automated Technology for Verification and Analysis A
AVSS Advanced Video and Signal Based Surveillance A
BMVC British Machine Vision Conference A
BPM International Conference in Business Process Management A
CADE International Conference on Automated Deduction A
CAIP International Conference on Computer Analysis of Images and Patterns A
CaiSE International Conference on Advanced Information Systems Engineering A
CANIM Computer Animation A
CASES International Conference on Compilers, Architecture, and Synthesis for Embedded Systems A
CBSE International Symposium Component-Based Software Engineering A
CC International Conference on Compiler Construction A
CCC IEEE Symposium on Computational Complexity A
CCGRID IEEE Symposium on Cluster Computing and the Grid A
CDC IEEE Conference on Decision and Control A
CGI Computer Graphics International A
CGO Code Generation and Optimization A
CIDR Conference on Innovative Data Systems Research A
CIKM ACM International Conference on Information and Knowledge Management A
CLUSTER Cluster Computing Conference A
COCOON International Conference on Computing and Combinatorics A
CogSci Annual Conference of the Cognitive Science Society A
COLING International Conference on Computational Liguistics A
CONCUR International Conference on Concurrency Theory A
CoNLL Conference on Natural Language Learning A
CoopIS International Conference on Cooperative Information Systems A
Coordination International Conference on Coordination Models and Lanuguages A
CP International Conference on Principles & Practice of Constraint Programming A
CPAIOR International Conference on Integration of Artificial Intelligence and Operations Research Techniques in Constraint Programming for Combinatorial Optimization Problems A
CSB IEEE Computational Systems Bioinformatics Conference A
CSCW ACM Conference on Computer Supported Cooperative Work A
CSFW IEEE Computer Security Foundations Workshop A
CSSAC Cognitive Science Society Annual Conference A
CVPR IEEE Conference on Computer Vision and Pattern Recognition A
DAC Design Automation Conf A
DAS International Workshop on Document Analysis Systems A
DASFAA Database Systems for Advanced Applications A
DEXA International Conference on Database and Expert Systems Applications A
DIGRA Digital Games Research Conference A
DISC International Symposium on Distributed Computing (ex WDAG) A
DocEng ACM Symposium on Document Engineering A
DOOD Deductive and Object-Oriented Databases A
DUX Design for User Experience A
EAAI Engineering Applications of Artifical Intelligence A
EASE International Conference on Evaluation and Assessment in Software Engineering A
ECWeb International Conference on Electronic Commerce and Web Technology A
EKAW International Conference on Knowledge Engineering and Knowledge Management A
EMMSAD Exploring Modelling Methods in Systems Analysis and Design A
EMNLP Empirical Methods in Natural Language Processing A
e-science IEEE International Conference on e-science and Grid Computing A
ESEM Internation Symposium on Empirical Software Engineering and Measurement A
FCCM IEEE Symposium on Field Programmable Custom Computing Machines A
FLOPS International Symposium on Functional and Logic Programming A
FODO International Conference on Foundation on Data Organization A
FORTE IFIP Joint Int’l Conference on Formal Description Techniques and Protocol Specification, Testing, And Verification A
FPSAC Formal Power Series and Algebraic Combinatorics A
FSE ACM Conference on the Foundations of Software Engineering (inc ESEC-FSE when held joInternationaly [sic]) A
FSR International Conference on Field and Service Robotics A
FST&TCS Foundations of Software Technology & Theoretical Computer Science A
FUZZ-IEEE IEEE International Conference on Fuzzy Systems A
Grid International Conference on Grid Computing A
Group ACM Special Interest Group on Supporting Group Work (was SIGGRoup) A
HiPC International Conference on High Performance Computing A
HOTCHIPS (HCS) Symposium on High Performance Chips A
HOTNETS ACM Workshop on Hot Topics in Networks A
HotOS USENIX Workshop on Hot Topics in Operating Systems A
HPDC IEEE International Symposium on High Performance Distributed Computing A
Hypertext ACM Conference on Hypertext and Hypermedia A
IC3N International Conference on Computer Communication and Networks A
ICALP International Colloquium on Automata, Languages and Programming A
ICALT IEEE International Conference on Advanced Learning Technologies A
ICARCV International Conference on Control, Automation, Robotics and Vision A
ICC IEEE International Conference on Communications A
ICCAD International Conference on Computer-Aided Design A
ICCL IEEE International Conference on Computer Languages A
ICCS International Conference on Computational Science A
ICCS International Conference on Conceptual Structures A
ICDAR IEEE International Conference on Document Analysis and Recognition A
ICDCS IEEE International Conference on Distributed Computing Systems A
ICDT International Conference on Database Theory A
ICECCS IEEE International Conference on Engineering and Complex Computer Systems A
ICER International Computing Education Research Workshop A
ICGG International Conference on Grid Computing A
ICIAP International Conference on Image Analysis and Processing A
ICIP IEEE International Conference on Image Processing A
ICLP International conference on Logic Programming A
ICMAS International Conference on Multi Agent Systems A
ICNN IEEE International Conference on Neural Networks A
ICNP International Conference on Network Protocols A
ICONIP International Conference on Neural Information Processing A
ICPP International Conference on Parallel Processing A
ICPR International Conference on Pattern Recognition A
ICS ACM International Conference on Supercomputing A
ICSC2 International Computer Symposium Conference A
ICSM International. Conferenceon Software Maintenance A
ICSOC International Conference on Service Oriented Computing A
ICSP International Conference on Software Process A
ICSPC International Conference on Security in Pervasive Computing A
ICSR IEEE International Conference on Software Reuse A
ICTL International Coference on Temporal Logic A
IDA Intelligent Data Analysis A
IEEE-Alife IEEE International Symposium on Artificial Life A
IEEE-CEC Congress on Evolutionary Computation A
IEEE-MM IEEE International Conference on Multimedia Computing and Systems A
IEEETKDE IEEE Transactions on Knowledge and Data Engineering A
IFIP_WG 11.3 IFIP WG 11.3 Working Conference on Data and Applications Security (was IFIP-DBSEC) A
IJCNLP International Joint Conference on Natural Language Processing A
IJCNN IEEE International Joint Conference on Neural Networks A
ILPS International Logic Programming Symposium A
IM IFIP/IEEE Integrated Management (odd years sharing with NOMS) A
IMC Internet Measurement Conference A
INTERACT IFIP International Conference on Human-Computer Interaction A
IPCO MPS Conference on integer programming & combinatorial optimization A
IPDPS IEEE International Parallel and Distributed Processing Symposium (was IPPS and SPDP) A
ISAAC International Symposium on Algorithms and Computation A
ISD International Conference on Information Systems Development A
ISESE International Symposium on Empirical Software Engineering A
ISMB Intelligent Systems in Molecular Biology A
ISR International Symposium on Robotics A
ISSCC IEEE International Solid-State Circuits Conference A
ISSR International Symposium on Robotics Research A
ISSRE International Symposium on Software Reliability Engineering A
ISSTA Internation Symposium on Software Testing and Analysis A
ISTA International Conference on Information Systems Technology and its Application A
ISTCS Israel Symposium on Theory of Computing and Systems A
ISWC International Semantic Web Conference A
ITiCSE Annual Conference on Integrating Technology into Computer Science Education A
ITS International Conference on Intelligent Tutoring Systems A
IUI Intelligent User Interfaces A
IVCNZ Image and Vision Computing Conference A
JICSLP/ICLP/ILPS International Conference/Symposium on Logic Programming (Joint) A
K-CAP Knowledge capture A
LCN IEEE Conference on Local Computer Networks A
LCTES ACM SIGPLAN Conference on Languages, Tools, and Compilers for Embedded Systems A
LPAR Logic Programming and Automated Reasoning A
LPNMR International Conference on Logic Programming and Non-monotonic Reasoning A
MASCOTS Symposium Model Analysis & Simulation of Computer & Telecommunications Systems A
MASS IEEE International Conference on Mobile Ad-hoc and Sensor Systems A
MassPar Symposium on Frontiers of Massively Parallel Processing A
MICRO International Symposium on Microarchitecture A
Middleware ACM/IFIP/USENIX th International Middleware Conference A
MIR ACM SIGMM International Woekshop on Multimedia Information Retrieval A
MMCN ACM/SPIE Multimedia Computing and Networking A
MMSP International Workshop on Multimedia Signal Processing A
MOBIHOC ACM Symposium of mobile and ad hoc computing A
MobileHCI International Conference on Human-Computer Interaction with Mobile Devices and Services A
Mobiquitous International Conference on Mobile and Ubiquitous Systems: Networks and Services A
Mobisys ACM SIGMOBILE International Conference on mobile systems, applications and services A
MODELS International Conference on the Unified Modeling Language (formerly UML) A
MSWIM ACM/IEEE International Conference on Modelling, Analysis and Simulation of Wireless and Mobile Systems A
NAACL North American Association for Computational Linguistics A
NDSS Usenix Networked and Distributed System Security Symposium A
NetStore Network Storage Symposium A
Networking 200X IFIP Networking 200X A
NOSSDAV Network and OS Support for Digital A/V A
NSDI Symposium on Networked Systems, Design and Implementation A
OPENARCH IEEE Conference on Open Architecture and Network Programming A
P2P IEEE International Conference on Peer-toPeer Computing A
PACT International Conference on Parallel Architecture and Compilation Techniques A
PADL Practical Aspects of Declarative Languages A
PADS ACM/IEEE/SCS Workshop on Parallel & Distributed Simulation A
PAKDD Pacific-Asia Conference on Knowledge Discovery and Data Mining A
PDC Participatory Design Conference A
PEPM ACM SIGPLAN Workshop on Partial Evalutation and Program Manipulation A
PERFORMANCE IFIP International Symposium on Computing Performance, Modelling, Measurement and Evaluation A
PG Pacific Graphics A
PPoPP Principles and Practice of Parallel Programming A
PPSN Parallel Problem Solving from Nature A
PRO-VE IFIP Working Conferences on Virtual Enterprises A
PT Performance Tools - International Conference on Model Techniques & Tools for CPE A
QoSA Conference on the Quality of Software Architectures A
QSIC International Quality Software Conference A
RAID Symposium on Recent Advances in Intrusion Detection A
RANDOM International Workshop on Randomization and Computation A
RE IEEE Requirements Engineering A
RECOMB Annual International Conferenceon Comp Molecular Biology A
RoboCup Robot Soccer World Cup A
RST International Conference on Reliable Software Technologies A
RTA International Conference on Rewriting Techniques and Applications A
RTAS IEEE Real-Time and Embedded Technology and Applications Symposium A
S&P IEEE Symposium on Security and Privacy A
SARA Symposium on Abstraction, Reformulation and Approximation A
SAS Static Analysis Symposium A
SAT International Conference on Theory and Applications of Satisfiability Testing A
SCA ACM SIGGRAPH/Eurographics Symposium on Computer Animation A
SCC IEEE International Conference on Services Computing A
SCG ACM Symposium on Computational Geometry A
SCOPES International Workshop on Software and Compilers for Embedded Systems A
SDM SIAM International Conference on Data Mining A
SDSDI Unix Symposium on Operating Systems Design and Implementation A
SIGCSE ACM Special Interest Group on Computer Science Education Conference A
SMS IEEE International Symposium on Software Metrics A
SPAA Symposium on Parallelism in Algorithms and Architectures A
SPICE Software Process Improvement and Capability Determination A
SRDS Symposium on Reliable Distributed Systems A
SSDBM International Conference on Scientific and Statistical Data Base Management A
SSPR Structural and Statistical pattern recognition A
SSR ACM Symposium on Software Reusability A
SSTD International Symposium on Spatial Databases A
STACS Symposium on Theoretical Aspects of Computer Science A
SUPER ACM/IEEE Supercomputing Conference A
SWAT Scandinavian Workshop on Algorithm Theory A
TABLEAUX International Conference on Theorem Proving with Analytic Tableaux and Related Methods A
TACAS Tools and Algorithms for Construction and Analysis of Systems A
TARK Theoretical Aspects of Rationality and Knowledge A
TIME International Symposium on Temporal Representation and Reasoning A
TREC Text Retrieval Conference A
UIST ACM Symposium on User Interface Software and Technology A
UM International Conference on User Modelling A
USENIX USENIX Annual Technical Conference A
USENIX-Security Usenix Security A
USITS Unix Symposium on Internet Technologies A
VCIP SPIE International Conference on Visual Communications and Image Processing A
VIS IEEE Visualization A
VL/HCC IEEE Symposium on Visual Languages and Human-Centric Computing (was VL) A
VLSI IEEE Symposium VLSI Circuits A
VMCAI Verification, Model Checking and Abstract Interpretation A
WACV IEEE Workshop on Apps of Computer Vision A
WADS Workshop on Algorithms and Data Structures A
WICSA EEE/IFIP Working Conference on Software Architecture A
WISE International Conference on Web Information Systems Engineering A
WoWMoM IEEE International Symposium on a World of Wireless, Mobile and Multimedia Networks A
WPHOL International Conference on Theorem Proving in Higher Order Logics A
ANNIE Artificial Neural Networks in Engineering Conference B
APCHI Asia-Pacific Conference on Computer Human Interaction B
CAIA Conference on Artificial Intelligence for Applications B
CCW IEEE Computer Communications Workshop B
CEC/EEE IEEE Conference on Electronic Commerce Technology and Enterprise Computing, e_Commerce and e-Services B
CGA Workshop on Computational Geometry and Applications B
CICLING Conference on Intelligent Text Processing and Computational Linguistics B
CompLife International Symposium on Computational Life Science B
COMPSAC International Computer Software and Applications Conference B
CSL, 2 th Annual Conference on Computer Science Logic B
DCOSS IEEE Conference on Distributed Computing in Sensor Systems B
DMTCS International Conference on Discrete Mathematics and Theoretical Computer Science B
DNA Meeting on DNA Based Computers B
ECBS Annual IEEE International Conference and Workshop on the Engineering of Computer Based Systems B
FOSSACS Foundations of Software Science and Computational Structures B
GECCO Genetic and Evolutionary Computations B
HPCN International Conference on High Performance Computing and Networking B
ICAIL International Conference on Artificial Intelligence and Law B
ICANN International Conference on Artificial Neural Networks B
ICCE International Conference on Computers in Education B
ICCI International Conference on Computing and Information B
ICDCN IEEE International Conference on Distributed Computing and Networking B
ICSC International Computer Science Conference B
ICTAC International Colloquium on Theoretical Ascpects of Computing B
ICTAI IEEE International Conference on Tools with Artificial Intelligence B
IEAAI International Conference on Industrial and Engineering Applications of Artificial Intelligence and Expert Systems B
IJCNLP2 International Joint Conference on Computational Linguistics B
IPCCC IEEE International Performance Computing and Communications Conference B
ISCC IEEE Symposium on Computers & Communications B
ISCIS International Symposium on Computer and Information Sciences B
IWANN International Work-Conference on Artificial and Natural Neural Networks B
IWCMC ACM International Wireless Communications and Mobile Computing Conference B
IWPEC International Workshop on Parameterized and Exact Computation B
JCSC Journal of Computing Science in Colleges (conference proceedings) B
Koli Calling Baltic Sea Conference on Computing Education Research B
LFCS Logical Foundations of Computer Science B
MCU Universal Machines and Computations B
MFCS Mathematical Foundations of Computer Science B
MPCS International Conference on Massively Parallel Computing Systems B
NORDCHI Norwegian Computer Human Interaction B
PACLIC Pacific Asia Conference on Language, Information and Computation B
PACLING Conference of the Pacific Association for Computational Linguistics B
PDCAT International Conference on Parallel and Distributed Computing, Applications and Technologies B
PRICAI Pacific Rim International Conference on Artificial Intelligence B
RTCSA International Conference on Real-Time and Embedded Computing Systems and Applications B
SAC ACM Symposium on Applied Computing B
SAFECOMP International Conference on Computer Safety, Reliability and Security B
SCSC Summer Computer Simulation Conference B
SIGCHI-NZ International NZ Conference on Computer-Human Interaction B
UMC Unconventional Models of Computation B
WAIS International Workshop on Artificial Intelligence and Statistics B
WoLLIC Workshop on Logic, Language, Information and Computation B
AdCom International Conference on Advanced Computing and Communications C
AIA Artificial Intelligence and Applications Conference C
AIL International Conference on Artificial Intelligence and Law C
AISAT International Conference on Artificial Intelligence in Science and Technology C
ANNES Conference on Artificial Neural Networks and Expert systems C
APCOMin Application of Computers and Operations Research in the Minerals Industries C
ASC IASTED International Conference on Artificial Intelligence and Soft Computing C
CAADRIA Conference on Computer Aided Architectural Design Research in Asia C
CAINE ISCA International Conference on Computer Applications in Industry and Engineering C
CATA International Conference on Computers and their Applications C
CATE IASTED International Conference on Computers and Advanced Technology in Education C
CCTAF Intelligent Multimedia, Computing and Communications Technologies and Applications of the Future C
CHPC International Conference on High Performance Computing C
CIBCB IEEE Symposium on Computational Intelligence in Bioinformatics and Computational Biology C
CIMCA International Conference on Computational Intelligence for Modelling, Control and Automation C
COMPDES International Symposium on Computer Design C
CSICC International CSI Computer Conference C
CTAC Computational Techniques and Applications Conference C
GeoComp International Conference on GeoComputation C
HCI International Conference on Human-Computer Interaction C
HealthCom International Workshop on Enterprise Networking and Computing in Health Care Industry C
HPC International Conference and Exhibition on High Performance Computing in the Asia-Pacific Region C
IADIS AC IADIS International Conference Applied Computing C
IC International Conference on Internet Computing C
IC-AI International Conference on Artificial Intelligence C
ICANNGA International Conference on Artificial Neural Networks and Genetic Algorithms C
ICCIMA International Conference on Computational Intelligence and Multimedia Applications C
ICCIT International Conference on Computer and Information Technology C
ICEC IEEE International Conference on Evolutionary Computation C
IICS Innovative Internet Computer Systems C
ISORC IEEE International Symposium on Object-Oriented Real-Time Distributed Computing C
IWCC IEEE International Workshop on Cluster Computing and the Grid C
JHPC Workshop On Java For High-Performance Computing C
LCCS International Workshop on Logic and Complexity in Computer Science C
NCCIS National Conference on Computer and Information Systems C
NeMLaP Joint Conference on New Methods in Language Processing and Computational Natural Language Learning C
NPSC International Conference on Neural, Parallel and Scientific Computations C
PARCO Parallel Computing C
PCW International Parallel Computing Workshop C
PDCN IASTED International Conference on Parallel and Distributed Computing and Networks C
PDCS IASTED International Conference on Parallel and Distributed Computing and Systems C
PSB Pacific Symposium on Biocomputing C
QuantCom International Conference on Experimental Implementation of Quantum Computation C

In addition to directly related papers, it’s important to explore related topics. Venue ranking can help us find high-quality places to look, especially for newer work that hasn’t been cited much yet. A good practice is to check out accepted papers in leading conferences early on. Read the ones close to your research and even those somewhat related. The community knows these papers, and if you don’t cite them or show how your work is different, your submission might face criticism or rejection.

Let’s make this post even more valuable! Share your favorite conferences or tips in the comments below. 🌐💬

Text Generation with Gradio

Gradio is a Python library that allows you to rapidly create user interfaces for deep learning / machine models. In this tutorial, we will walk through the process of creating a Gradio app for text generation using a pre-trained language model.

Step 1 : Prerequisites

Before you begin, make sure you have the following installed:

  • Python (3.8 or later)

For text generation, you can use popular language models like GPT-2, GPT-3, or any other model that suits your needs. Ensure you have the model and its dependencies installed.

1
2
3
pip install transformers==4.35
pip install torch==2.1.1
pip install gradio==4.4.1

Step 2: Create a Text Generation Function

Write a Python function that takes a prompt as input and generates text using the pre-trained language model. Here’s a simple example using the GPT-2 model from the transformers library:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

import torch
import transformers
import gradio as gr
from transformers import AutoModelForCausalLM, GPT2Tokenizer

model_name = "gpt2"
model = AutoModelForCasualLM.from_pretrained(model_name)
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
if tokenizer.pad_token_id is None:
tokenizer.pad_token_id = tokenizer.eos_token_id

def generate_text(prompt):
inputs = tokenizer([prompt], return_tensors="pt")
output = model.generate(inputs, max_length=100, do_sample= True, top_k=50, top_p=0.95)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)

return generated_text

Step 3: Create a Gradio Interface

Now, create a Gradio interface for your text generation function. Define an interface with an input text box for the prompt and an output text box to display the generated text.

1
2
3

demo = gr.Interface(fn=generate_text, inputs="text", outputs="text")
demo.launch(server_name="0.0.0.0", server_port=7861)

Step 4: Run Your Gradio App

Save the script and run it. Gradio will launch a local web interface @ localhost:7861 for your text generation app. With this command you can auto-reload the browser when you make changes to your app. Open your web browser and navigate to the provided URL to interact with the app.

1
gradio app.py

Step 5 : Interact with Your Text Generation App

Enter a prompt in the input text box and see the generated text in the output text box. Experiment with different prompts to observe how the model responds. This how your first look of app will be

Initial Look

Step 6 : (Pro Tip) Lets add some good looks to this App

We can start with adding the description. So lets do that. We can also add more input to our app to have more control over our output. Update your Interface class with the following changes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
description = """
# Deploy your first ML app using Gradio
"""
inputs = [
gr.Textbox(label="Prompt text"),
gr.Textbox(label="max-lenth generation", value=100),
gr.Slider(0.0, 1.0, label="top-p value", value=0.95),
gr.Textbox(label="top-k", value=50,),
]
outputs = [gr.Textbox(label="Generated Text")]

demo = gr.Interface(fn=generate_text, inputs=inputs, outputs=outputs, allow_flagging=False, description=description)

demo.launch(server_name="0.0.0.0", server_port=7861)

Step 7 : (Pro Tip) Animated text generation

Also text generation is taking time so it will be good if we can show the text word by word right. Lets do that by using some thread and TextIteratorStreamer class. Now update the generate_text method with following changes:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from threading import Thread
from transformers import TextIteratorStreamer

streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens = True)

def generate_text(prompt, max_length, top_p, top_k):
inputs = tokenizer([prompt], return_tensors="pt")

generate_kwargs = dict(
inputs,
max_length=int(max_length),top_p=float(top_p), do_sample=True, top_k=int(top_k), streamer=streamer
)

t = Thread(target=model.generate, kwargs=generate_kwargs)
t.start()

generated_text=[]

for text in streamer:
generated_text.append(text)
yield "".join(generated_text)

Conclusion

Congratulations! You have created a simple Gradio app for text generation.

Final Look

You can further customize the interface, explore different pre-trained models, and enhance the user experience. Gradio simplifies the process of creating interactive machine learning applications, making it easy for users to interact with your models.

Exporting an ONNX Model from Caffe2

Caffe2 supports exporting models directly to ONNX. Here are the steps:

  1. Install Caffe2 by following the instructions provided in the official Caffe2 documentation.

  2. Import the necessary libraries in your Python script:

    1
    2
    from caffe2.python.onnx import backend as caffe2_backend
    import torch.onnx
  3. Load your Caffe2 model into PyTorch:

    1
    2
    # Assuming you already have a Caffe2 model loaded
    torch_model = torch.onnx.load("path/to/caffe2_model.pb")
  4. Export the PyTorch model to ONNX:

    1
    torch.onnx.export(torch_model, torch.randn(1, 3, 224, 224), "path/to/exported_model.onnx", verbose=True)

    Adjust the input shape and replace “path/to/exported_model.onnx” with the desired path to save the ONNX file.